Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prettyjson

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettyjson - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

16

lib/prettyjson.js

@@ -11,5 +11,9 @@ 'use strict';

var isSerializable = function(input, onlyPrimitives, options) {
if (typeof input === 'boolean' ||
typeof input === 'number' || input === null ||
input instanceof Date) {
if (
typeof input === 'boolean' ||
typeof input === 'number' ||
typeof input === 'function' ||
input === null ||
input instanceof Date
) {
return true;

@@ -54,2 +58,6 @@ }

}
if (typeof input === 'function') {
return 'function() {}';
}
if (Array.isArray(input)) {

@@ -75,3 +83,3 @@ return input.join(', ');

//unserializable string means it's multiline
// Unserializable string means it's multiline
if (typeof data === 'string') {

@@ -78,0 +86,0 @@ return [

@@ -5,3 +5,3 @@ {

"description": "Package for formatting JSON data in a coloured YAML-style, perfect for CLI output",
"version": "1.2.0",
"version": "1.2.1",
"homepage": "http://rafeca.com/prettyjson",

@@ -8,0 +8,0 @@ "keywords": [

@@ -43,2 +43,12 @@ 'use strict';

it('should output a function', function() {
var input = ['first string', function(a) { return a;}];
var output = prettyjson.render(input);
output.should.equal([
colors.green('- ') + input[0],
colors.green('- ') + 'function() {}',
].join('\n'));
});
it('should output an array of arrays', function() {

@@ -45,0 +55,0 @@ var input = ['first string', ['nested 1', 'nested 2'], 'second string'];

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc