json-buffer
Advanced tools
Comparing version 2.0.11 to 3.0.0
@@ -6,2 +6,4 @@ //TODO: handle reviver/dehydrate function like normal | ||
exports.stringify = function stringify (o) { | ||
if('undefined' == typeof o) return o | ||
if(o && Buffer.isBuffer(o)) | ||
@@ -26,3 +28,6 @@ return JSON.stringify(':base64:' + o.toString('base64')) | ||
if (array) { | ||
s += stringify(o[k]) | ||
if(o[k] == undefined) | ||
s += 'null' | ||
else | ||
s += stringify(o[k]) | ||
} else if (o[k] !== void(0)) { | ||
@@ -29,0 +34,0 @@ s += stringify(k) + ':' + stringify(o[k]) |
{ | ||
"name": "json-buffer", | ||
"description": "JSON parse & stringify that supports binary via bops & base64", | ||
"version": "2.0.11", | ||
"version": "3.0.0", | ||
"homepage": "https://github.com/dominictarr/json-buffer", | ||
@@ -11,3 +11,3 @@ "repository": { | ||
"devDependencies": { | ||
"tape": "~1.0.2" | ||
"tape": "^4.6.3" | ||
}, | ||
@@ -14,0 +14,0 @@ "scripts": { |
@@ -42,3 +42,4 @@ | ||
fn: function () {} | ||
} | ||
}, | ||
undefined: undefined | ||
} | ||
@@ -50,5 +51,10 @@ | ||
var s = _JSON.stringify(value) | ||
console.log(s) | ||
var _value = _JSON.parse(s) | ||
t.deepEqual(clone(_value), clone(value)) | ||
console.log('parse', s) | ||
if(JSON.stringify(value) !== undefined) { | ||
console.log(s) | ||
var _value = _JSON.parse(s) | ||
t.deepEqual(clone(_value), clone(value)) | ||
} | ||
else | ||
t.equal(s, undefined) | ||
t.end() | ||
@@ -58,1 +64,3 @@ }) | ||
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
5436
106