Socket
Socket
Sign inDemoInstall

json-stable-stringify

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-stable-stringify - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

2

index.js

@@ -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}');
});
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