Comparing version 2.9.0 to 3.0.0
22
index.js
@@ -32,8 +32,2 @@ '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.. | ||
const B = Buffer.alloc ? Buffer | ||
: /* istanbul ignore next */ require('safe-buffer').Buffer | ||
// events that mean 'the stream is over' | ||
@@ -53,3 +47,3 @@ // these are treated specially, and re-emitted | ||
const isArrayBufferView = b => !B.isBuffer(b) && ArrayBuffer.isView(b) | ||
const isArrayBufferView = b => !Buffer.isBuffer(b) && ArrayBuffer.isView(b) | ||
@@ -131,7 +125,7 @@ module.exports = class Minipass extends EE { | ||
// anything else switches us into object mode | ||
if (!this[OBJECTMODE] && !B.isBuffer(chunk)) { | ||
if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) { | ||
if (isArrayBufferView(chunk)) | ||
chunk = B.from(chunk.buffer, chunk.byteOffset, chunk.byteLength) | ||
chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength) | ||
else if (isArrayBuffer(chunk)) | ||
chunk = B.from(chunk) | ||
chunk = Buffer.from(chunk) | ||
else if (typeof chunk !== 'string') | ||
@@ -158,6 +152,6 @@ // use the setter so we throw if we have encoding set | ||
!(encoding === this[ENCODING] && !this[DECODER].lastNeed)) { | ||
chunk = B.from(chunk, encoding) | ||
chunk = Buffer.from(chunk, encoding) | ||
} | ||
if (B.isBuffer(chunk) && this[ENCODING]) | ||
if (Buffer.isBuffer(chunk) && this[ENCODING]) | ||
chunk = this[DECODER].write(chunk) | ||
@@ -195,3 +189,3 @@ | ||
this.buffer = new Yallist([ | ||
B.concat(Array.from(this.buffer), this[BUFFERLENGTH]) | ||
Buffer.concat(Array.from(this.buffer), this[BUFFERLENGTH]) | ||
]) | ||
@@ -446,3 +440,3 @@ } | ||
? Promise.reject(new Error('cannot concat in objectMode')) | ||
: this[ENCODING] ? buf.join('') : B.concat(buf, buf.dataLength)) | ||
: this[ENCODING] ? buf.join('') : Buffer.concat(buf, buf.dataLength)) | ||
} | ||
@@ -449,0 +443,0 @@ |
{ | ||
"name": "minipass", | ||
"version": "2.9.0", | ||
"version": "3.0.0", | ||
"description": "minimal implementation of a PassThrough stream", | ||
"main": "index.js", | ||
"dependencies": { | ||
"safe-buffer": "^5.1.2", | ||
"yallist": "^3.0.0" | ||
"yallist": "^4.0.0" | ||
}, | ||
@@ -18,3 +17,3 @@ "devDependencies": { | ||
"preversion": "npm test", | ||
"postversion": "npm publish", | ||
"postversion": "npm publish --tag=next", | ||
"postpublish": "git push origin --follow-tags" | ||
@@ -37,3 +36,6 @@ }, | ||
"check-coverage": true | ||
}, | ||
"engines": { | ||
"node": ">=8" | ||
} | ||
} |
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
1
36316
456
+ Addedyallist@4.0.0(transitive)
- Removedsafe-buffer@^5.1.2
- Removedsafe-buffer@5.2.1(transitive)
- Removedyallist@3.1.1(transitive)
Updatedyallist@^4.0.0