Comparing version 2.2.3 to 2.2.4
15
index.js
@@ -21,2 +21,11 @@ 'use strict' | ||
// Buffer in node 4.x < 4.5.0 doesn't have working Buffer.from | ||
// or Buffer.alloc, and Buffer in node 10 deprecated the ctor. | ||
// .M, this is fine .\^/M.. | ||
let B = Buffer | ||
/* istanbul ignore next */ | ||
if (!B.alloc) { | ||
B = require('safe-buffer').Buffer | ||
} | ||
class MiniPass extends EE { | ||
@@ -83,6 +92,6 @@ constructor (options) { | ||
!(encoding === this[ENCODING] && !this[DECODER].lastNeed)) { | ||
chunk = Buffer.from(chunk, encoding) | ||
chunk = B.from(chunk, encoding) | ||
} | ||
if (Buffer.isBuffer(chunk) && this[ENCODING]) | ||
if (B.isBuffer(chunk) && this[ENCODING]) | ||
chunk = this[DECODER].write(chunk) | ||
@@ -116,3 +125,3 @@ | ||
this.buffer = new Yallist([ | ||
Buffer.concat(Array.from(this.buffer), this[BUFFERLENGTH]) | ||
B.concat(Array.from(this.buffer), this[BUFFERLENGTH]) | ||
]) | ||
@@ -119,0 +128,0 @@ } |
{ | ||
"name": "minipass", | ||
"version": "2.2.3", | ||
"version": "2.2.4", | ||
"description": "minimal implementation of a PassThrough stream", | ||
"main": "index.js", | ||
"dependencies": { | ||
"safe-buffer": "^5.1.1", | ||
"yallist": "^3.0.0" | ||
@@ -8,0 +9,0 @@ }, |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
9926
261
0
2
+ Addedsafe-buffer@^5.1.1
+ Addedsafe-buffer@5.2.1(transitive)