safe-buffer
Advanced tools
Comparing version 5.1.0 to 5.1.1
14
index.js
@@ -5,2 +5,8 @@ /* eslint-disable node/no-deprecated-api */ | ||
// alternative to using Object.keys for old browsers | ||
function copyProps (src, dst) { | ||
for (var key in src) { | ||
dst[key] = src[key] | ||
} | ||
} | ||
if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { | ||
@@ -10,5 +16,3 @@ module.exports = buffer | ||
// Copy properties from require('buffer') | ||
Object.keys(buffer).forEach(function (prop) { | ||
exports[prop] = buffer[prop] | ||
}) | ||
copyProps(buffer, exports) | ||
exports.Buffer = SafeBuffer | ||
@@ -22,5 +26,3 @@ } | ||
// Copy static methods from Buffer | ||
Object.keys(Buffer).forEach(function (prop) { | ||
SafeBuffer[prop] = Buffer[prop] | ||
}) | ||
copyProps(Buffer, SafeBuffer) | ||
@@ -27,0 +29,0 @@ SafeBuffer.from = function (arg, encodingOrOffset, length) { |
{ | ||
"name": "safe-buffer", | ||
"description": "Safer Node.js Buffer API", | ||
"version": "5.1.0", | ||
"version": "5.1.1", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Feross Aboukhadijeh", |
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
25870
144