From 371655a6b0e6664fec67f16cb247cc9f174a5197 Mon Sep 17 00:00:00 2001 From: Gar Date: Wed, 15 Sep 2021 13:04:16 -0700 Subject: [PATCH] deps: minipass@3.1.5 * fix: re-emit 'error' event if missed and new listener added * fix: do not blow up if process is missing --- node_modules/minipass/index.js | 14 ++++++++++++-- node_modules/minipass/package.json | 4 ++-- package-lock.json | 12 ++++++------ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/node_modules/minipass/index.js b/node_modules/minipass/index.js index 56cbd665d2526..ae134a066d77f 100644 --- a/node_modules/minipass/index.js +++ b/node_modules/minipass/index.js @@ -1,4 +1,8 @@ 'use strict' +const proc = typeof process === 'object' && process ? process : { + stdout: null, + stderr: null, +} const EE = require('events') const Stream = require('stream') const Yallist = require('yallist') @@ -8,6 +12,7 @@ const EOF = Symbol('EOF') const MAYBE_EMIT_END = Symbol('maybeEmitEnd') const EMITTED_END = Symbol('emittedEnd') const EMITTING_END = Symbol('emittingEnd') +const EMITTED_ERROR = Symbol('emittedError') const CLOSED = Symbol('closed') const READ = Symbol('read') const FLUSH = Symbol('flush') @@ -66,6 +71,7 @@ module.exports = class Minipass extends Stream { this[EMITTED_END] = false this[EMITTING_END] = false this[CLOSED] = false + this[EMITTED_ERROR] = null this.writable = true this.readable = true this[BUFFERLENGTH] = 0 @@ -310,7 +316,7 @@ module.exports = class Minipass extends Stream { const ended = this[EMITTED_END] opts = opts || {} - if (dest === process.stdout || dest === process.stderr) + if (dest === proc.stdout || dest === proc.stderr) opts.end = false else opts.end = opts.end !== false @@ -339,6 +345,8 @@ module.exports = class Minipass extends Stream { else if (isEndish(ev) && this[EMITTED_END]) { super.emit(ev) this.removeAllListeners(ev) + } else if (ev === 'error' && this[EMITTED_ERROR]) { + fn.call(this, this[EMITTED_ERROR]) } } } @@ -400,6 +408,8 @@ module.exports = class Minipass extends Stream { // don't emit close before 'end' and 'finish' if (!this[EMITTED_END] && !this[DESTROYED]) return + } else if (ev === 'error') { + this[EMITTED_ERROR] = data } // TODO: replace with a spread operator when Node v4 support drops @@ -452,8 +462,8 @@ module.exports = class Minipass extends Stream { promise () { return new Promise((resolve, reject) => { this.on(DESTROYED, () => reject(new Error('stream destroyed'))) - this.on('end', () => resolve()) this.on('error', er => reject(er)) + this.on('end', () => resolve()) }) } diff --git a/node_modules/minipass/package.json b/node_modules/minipass/package.json index 54f62d56d46d8..165fa662ab4a7 100644 --- a/node_modules/minipass/package.json +++ b/node_modules/minipass/package.json @@ -1,6 +1,6 @@ { "name": "minipass", - "version": "3.1.3", + "version": "3.1.5", "description": "minimal implementation of a PassThrough stream", "main": "index.js", "dependencies": { @@ -8,7 +8,7 @@ }, "devDependencies": { "end-of-stream": "^1.4.0", - "tap": "^14.6.5", + "tap": "^15.0.9", "through2": "^2.0.3" }, "scripts": { diff --git a/package-lock.json b/package-lock.json index 8f4a37801185a..be697701ff43b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5114,9 +5114,9 @@ "dev": true }, "node_modules/minipass": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz", - "integrity": "sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.5.tgz", + "integrity": "sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==", "inBundle": true, "dependencies": { "yallist": "^4.0.0" @@ -14232,9 +14232,9 @@ "dev": true }, "minipass": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz", - "integrity": "sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.5.tgz", + "integrity": "sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==", "requires": { "yallist": "^4.0.0" }