prettyjson
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -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']; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
625454
570