Comparing version 4.0.5 to 4.1.0
@@ -11,2 +11,19 @@ const https = require('https'); | ||
function parseBuffers (value) { | ||
if (Buffer.isBuffer(value)) { | ||
return value; | ||
} else if (Array.isArray(value)) { | ||
return value.map(v => parseBuffers(v)); | ||
} else if (typeof value === 'object' && Object.keys(value).length === 1 && typeof value._base64 === 'string') { | ||
return Buffer.from(value._base64, 'base64'); | ||
} else if (typeof value === 'object') { | ||
return Object.keys(value).reduce((n, key) => { | ||
n[key] = parseBuffers(value[key]); | ||
return n; | ||
}, {}); | ||
} else { | ||
return value; | ||
} | ||
}; | ||
module.exports = (cfg, names, params, callback) => { | ||
@@ -95,2 +112,3 @@ | ||
response = parseBuffers(response); | ||
responded = true; | ||
@@ -97,0 +115,0 @@ |
{ | ||
"name": "lib", | ||
"version": "4.0.5", | ||
"version": "4.1.0", | ||
"description": "StdLib: Standard Library for Microservices Node.js Bindings", | ||
@@ -5,0 +5,0 @@ "main": "lib.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
16008
302