serialize-to-js
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -29,3 +29,3 @@ /* | ||
Ref.wrapkey = function(key) { | ||
return (KEY.test(key) ? key : '"'+key+'"'); | ||
return (KEY.test(key) ? key : '"'+key.replace(/"/g,'\\"')+'"'); | ||
}; | ||
@@ -32,0 +32,0 @@ |
{ | ||
"name": "serialize-to-js", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "serialize objects to javascript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -115,7 +115,8 @@ 'use strict'; | ||
"3": "3", | ||
"4 four": "four" | ||
"4 four": "four", | ||
"five\"(5)": 5, | ||
}; | ||
var o = { a: o1, b: o1 }; | ||
var res = M.serialize(o); | ||
var exp = '{a: {"3": "3", one: true, "thr-ee": undefined, "4 four": "four"}, b: {"3": "3", one: true, "thr-ee": undefined, "4 four": "four"}}'; | ||
var exp = '{a: {"3": "3", one: true, "thr-ee": undefined, "4 four": "four", "five\\"(5)": 5}, b: {"3": "3", one: true, "thr-ee": undefined, "4 four": "four", "five\\"(5)": 5}}'; | ||
//~ console.log(res); | ||
@@ -122,0 +123,0 @@ assert.equal(res, exp); |
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
17803
434