prettyjson
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -43,3 +43,3 @@ 'use strict'; | ||
if (typeof input === 'boolean' || | ||
typeof input === 'number' || input === null || | ||
typeof input === 'number' || input === null || | ||
input instanceof Date) { | ||
@@ -101,3 +101,3 @@ return true; | ||
// Render a string exactly equal | ||
if (isSerializable(data)) { | ||
if (isSerializable(data)) { | ||
output.push(Utils.indent(indentation) + addColorToData(data)); | ||
@@ -104,0 +104,0 @@ } |
@@ -17,2 +17,7 @@ 'use strict'; | ||
Object.getOwnPropertyNames(input).forEach(function(key) { | ||
// Skip undefined values. | ||
if (input[key] === undefined) { | ||
return; | ||
} | ||
maxWidth = Math.max(maxWidth, key.length); | ||
@@ -19,0 +24,0 @@ }); |
@@ -5,3 +5,3 @@ { | ||
"description": "Package for formatting JSON data in a coloured YAML-style, perfect for CLI output", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"homepage": "http://rafeca.com/prettyjson", | ||
@@ -34,18 +34,14 @@ "keywords": [ | ||
}, | ||
"engines": { | ||
"node": ">= 0.10.0 < 0.13.0" | ||
}, | ||
"dependencies": { | ||
"colors": "0.6.2", | ||
"minimist": "1.1.0" | ||
"colors": "^1.1.2", | ||
"minimist": "^1.1.3" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^1.18.2", | ||
"should": "^3.1.4", | ||
"coveralls": "^2.11.3", | ||
"istanbul": "^0.3.17", | ||
"jshint": "^2.4.4", | ||
"getversion": "~0.1.1", | ||
"istanbul": "~0.2.4", | ||
"coveralls": "^2.10.0", | ||
"mocha-lcov-reporter": "0.0.1" | ||
"mocha": "^2.2.5", | ||
"mocha-lcov-reporter": "0.0.2", | ||
"should": "^7.0.2" | ||
} | ||
} |
@@ -267,3 +267,3 @@ var prettyjson = process.env.EXPRESS_COV ? require('../lib-cov/prettyjson') : require('../lib/prettyjson'); | ||
' ' + '- '.green + stack[1], | ||
' ' + 'message: '.green + ' foo' | ||
' ' + 'message: '.green + 'foo' | ||
].join('\n')); | ||
@@ -285,22 +285,22 @@ }); | ||
}); | ||
it('should print dates correctly', function() { | ||
var input = new Date(); | ||
var expected = input.toString(); | ||
var expected = input.toString(); | ||
var output = prettyjson.render(input, {}, 4); | ||
output.should.equal(' ' + expected); | ||
}); | ||
it('should print dates in objects correctly', function() { | ||
var dt1 = new Date(); | ||
var dt2 = new Date(); | ||
var input = { | ||
var input = { | ||
dt1: dt2, | ||
dt2: dt2 | ||
}; | ||
}; | ||
var output = prettyjson.render(input, {}, 4); | ||
output.should.equal([ | ||
@@ -307,0 +307,0 @@ ' ' + 'dt1: '.green + dt1.toString(), |
Sorry, the diff of this file is not supported yet
623369
6
495
+ Addedcolors@1.4.0(transitive)
+ Addedminimist@1.2.8(transitive)
- Removedcolors@0.6.2(transitive)
- Removedminimist@1.1.0(transitive)
Updatedcolors@^1.1.2
Updatedminimist@^1.1.3