json-stable-stringify
Advanced tools
Comparing version 0.0.0 to 0.0.1
@@ -17,3 +17,3 @@ var json = typeof JSON !== 'undefined' ? JSON : require('jsonify'); | ||
return (function stringify (node) { | ||
if (typeof node !== 'object') { | ||
if (typeof node !== 'object' || node === null) { | ||
return json.stringify(node); | ||
@@ -20,0 +20,0 @@ } |
{ | ||
"name": "json-stable-stringify", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "deterministic JSON.stringify() with custom sorting to get deterministic hashes from stringified results", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,4 +6,4 @@ var test = require('tape'); | ||
t.plan(1); | ||
var obj = { c: 6, b: [4,5], a: 3 }; | ||
t.equal(stringify(obj), '{"a":3,"b":[4,5],"c":6}'); | ||
var obj = { c: 6, b: [4,5], a: 3, z: null }; | ||
t.equal(stringify(obj), '{"a":3,"b":[4,5],"c":6,"z":null}'); | ||
}); |
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
6975