File tree Expand file tree Collapse file tree 2 files changed +2
-9
lines changed Expand file tree Collapse file tree 2 files changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -25,13 +25,6 @@ var UNICODE_CHARS = {
25
25
'\u2029' : '\\u2029'
26
26
} ;
27
27
28
- // There's an issue with Node 0.10 (V8 3.14.5.9) which causes `JSON.stringify()`
29
- // and the subsequent `str.replace()` call to take over 100x more time than when
30
- // a the `JSON.stringify()` replacer function is used and the data being
31
- // serialized is very large (500KB). A remedy to this is setting the
32
- // `JSON.stringify()` `space` option to a truthy value.
33
- var SPACE = 2 ;
34
-
35
28
module . exports = function serialize ( obj ) {
36
29
var functions = [ ] ;
37
30
var regexps = [ ] ;
@@ -50,7 +43,7 @@ module.exports = function serialize(obj) {
50
43
}
51
44
52
45
return value ;
53
- } , SPACE ) ;
46
+ } ) ;
54
47
55
48
// Protects against `JSON.stringify()` returning `undefined`, by serializing
56
49
// to the literal string: "undefined".
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ describe('serialize( obj )', function () {
46
46
} ) ;
47
47
48
48
it ( 'should serialize JSON to a JSON string' , function ( ) {
49
- expect ( serialize ( data ) ) . to . equal ( JSON . stringify ( data , null , 2 ) ) ;
49
+ expect ( serialize ( data ) ) . to . equal ( JSON . stringify ( data ) ) ;
50
50
} ) ;
51
51
52
52
it ( 'should deserialize a JSON string to a JSON object' , function ( ) {
You can’t perform that action at this time.
0 commit comments