deterministic-json
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -27,2 +27,8 @@ let stableStringify = require('json-stable-stringify') | ||
// converts buffer to base64 and strips trailing equals chars | ||
function bufferToBase64 (buffer) { | ||
let actualLength = Math.floor(buffer.length / 3) * 4 + 2 | ||
return buffer.toString('base64').slice(0, actualLength) | ||
} | ||
function bufferToBase64Replacer (key, value) { | ||
@@ -40,3 +46,3 @@ // convert JSON.stringified Buffer objects to Buffer, | ||
if (!Buffer.isBuffer(value)) return value | ||
return `${base64Prefix}${value.toString('base64')}` | ||
return `${base64Prefix}${bufferToBase64(value)}` | ||
} | ||
@@ -43,0 +49,0 @@ |
{ | ||
"name": "deterministic-json", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Deterministic JSON parse/stringify that supports Buffers", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
3141
3
60
0
20