File tree Expand file tree Collapse file tree 3 files changed +14
-16
lines changed
Expand file tree Collapse file tree 3 files changed +14
-16
lines changed File renamed without changes.
Original file line number Diff line number Diff line change 1- var json = typeof JSON !== 'undefined' ? JSON : require ( 'jsonify' ) ;
1+ 'use strict' ;
22
33module . exports = function ( obj , opts ) {
44 if ( ! opts ) opts = { } ;
@@ -33,19 +33,19 @@ module.exports = function (obj, opts) {
3333 return ;
3434 }
3535 if ( typeof node !== 'object' || node === null ) {
36- return json . stringify ( node ) ;
36+ return JSON . stringify ( node ) ;
3737 }
3838 if ( isArray ( node ) ) {
3939 var out = [ ] ;
4040 for ( var i = 0 ; i < node . length ; i ++ ) {
41- var item = stringify ( node , i , node [ i ] , level + 1 ) || json . stringify ( null ) ;
41+ var item = stringify ( node , i , node [ i ] , level + 1 ) || JSON . stringify ( null ) ;
4242 out . push ( indent + space + item ) ;
4343 }
4444 return '[' + out . join ( ',' ) + indent + ']' ;
4545 }
4646 else {
4747 if ( seen . indexOf ( node ) !== - 1 ) {
48- if ( cycles ) return json . stringify ( '__cycle__' ) ;
48+ if ( cycles ) return JSON . stringify ( '__cycle__' ) ;
4949 throw new TypeError ( 'Converting circular structure to JSON' ) ;
5050 }
5151 else seen . push ( node ) ;
@@ -58,7 +58,7 @@ module.exports = function (obj, opts) {
5858
5959 if ( ! value ) continue ;
6060
61- var keyValue = json . stringify ( key )
61+ var keyValue = JSON . stringify ( key )
6262 + colonSeparator
6363 + value ;
6464 ;
Original file line number Diff line number Diff line change 11{
2- "name" : " json-stable-stringify" ,
3- "version" : " 1.0.1 " ,
4- "description" : " deterministic JSON.stringify() with custom sorting to get deterministic hashes from stringified results" ,
2+ "name" : " fast- json-stable-stringify" ,
3+ "version" : " 1.0.2 " ,
4+ "description" : " deterministic JSON.stringify() to get deterministic hashes from stringified results" ,
55 "main" : " index.js" ,
6- "dependencies" : {
7- "jsonify" : " ~0.0.0"
8- },
96 "devDependencies" : {
107 "tape" : " ~1.0.4"
118 },
1613 "files" : " test/*.js" ,
1714 "browsers" : [
1815 " ie/8..latest" ,
19- " ff/5" , " ff/latest" ,
20- " chrome/15" , " chrome/latest" ,
16+ " ff/5" ,
17+ " ff/latest" ,
18+ " chrome/15" ,
19+ " chrome/latest" ,
2120 " safari/latest" ,
2221 " opera/latest"
2322 ]
2423 },
2524 "repository" : {
2625 "type" : " git" ,
27- "url" : " git://github.com/substack/ json-stable-stringify.git"
26+ "url" : " git://github.com/epoberezkin/fast- json-stable-stringify.git"
2827 },
29- "homepage" : " https://github.com/substack/ json-stable-stringify" ,
28+ "homepage" : " https://github.com/epoberezkin/fast- json-stable-stringify" ,
3029 "keywords" : [
3130 " json" ,
3231 " stringify" ,
3332 " deterministic" ,
3433 " hash" ,
35- " sort" ,
3634 " stable"
3735 ],
3836 "author" : {
You can’t perform that action at this time.
0 commit comments