json-bigint
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -350,4 +350,3 @@ var BigNumber = null; | ||
text = source; | ||
text = source + ''; | ||
at = 0; | ||
@@ -371,12 +370,10 @@ ch = ' '; | ||
if (value && typeof value === 'object') { | ||
for (k in value) { | ||
if (Object.prototype.hasOwnProperty.call(value, k)) { | ||
v = walk(value, k); | ||
if (v !== undefined) { | ||
value[k] = v; | ||
} else { | ||
delete value[k]; | ||
} | ||
Object.keys(value).forEach(function(k) { | ||
v = walk(value, k); | ||
if (v !== undefined) { | ||
value[k] = v; | ||
} else { | ||
delete value[k]; | ||
} | ||
} | ||
}); | ||
} | ||
@@ -383,0 +380,0 @@ return reviver.call(holder, key, value); |
@@ -217,3 +217,4 @@ var BigNumber = require('bignumber.js'); | ||
partial, | ||
value = holder[key]; | ||
value = holder[key], | ||
isBigNumber = value instanceof BigNumber; | ||
@@ -238,3 +239,7 @@ // If the value has a toJSON method, call it to obtain a replacement value. | ||
case 'string': | ||
return quote(value); | ||
if (isBigNumber) { | ||
return value; | ||
} else { | ||
return quote(value); | ||
} | ||
@@ -268,5 +273,2 @@ case 'number': | ||
if (value instanceof BigNumber) | ||
return value.toString(); | ||
// Make an array to hold the partial results of stringifying this object value. | ||
@@ -318,10 +320,8 @@ | ||
for (k in value) { | ||
if (Object.prototype.hasOwnProperty.call(value, k)) { | ||
v = str(k, value); | ||
if (v) { | ||
partial.push(quote(k) + (gap ? ': ' : ':') + v); | ||
} | ||
Object.keys(value).forEach(function(k) { | ||
var v = str(k, value); | ||
if (v) { | ||
partial.push(quote(k) + (gap ? ': ' : ':') + v); | ||
} | ||
} | ||
}); | ||
} | ||
@@ -328,0 +328,0 @@ |
{ | ||
"name": "json-bigint", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "JSON.parse with bigints support", | ||
@@ -23,3 +23,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"bignumber.js": "~1.1.1" | ||
"bignumber.js": "^2.4.0" | ||
}, | ||
@@ -26,0 +26,0 @@ "devDependencies": { |
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
35410
698
+ Addedbignumber.js@2.4.0(transitive)
- Removedbignumber.js@1.1.1(transitive)
Updatedbignumber.js@^2.4.0