js-stringify
Advanced tools
Comparing version
@@ -8,5 +8,8 @@ 'use strict'; | ||
} | ||
if (obj === undefined) { | ||
return 'undefined'; | ||
} | ||
return JSON.stringify(obj) | ||
.replace(/\u2028/g, '\\u2028') | ||
.replace(/\u2029/g, '\\u2029'); | ||
} | ||
} |
{ | ||
"name": "js-stringify", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Stringify an object so it can be safely inlined in JavaScript code", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
@@ -0,0 +0,0 @@ # js-stringify |
@@ -10,3 +10,5 @@ 'use strict'; | ||
assert(stringify({foo: 'bar'}) === '{"foo":"bar"}'); | ||
assert(stringify(undefined) === 'undefined'); | ||
assert(stringify(null) === 'null'); | ||
console.log('tests passed'); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
3250
2.14%23
35.29%