pnpm 6.32.21 → 6.32.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@ packageManager: pnpm@7.0.0-alpha.2
11
11
  pendingBuilds:
12
12
  - /node-gyp/8.4.1
13
13
  - /encoding/0.1.13
14
- prunedAt: Thu, 09 Jun 2022 09:31:17 GMT
14
+ prunedAt: Wed, 22 Jun 2022 11:56:40 GMT
15
15
  publicHoistPattern:
16
16
  - '*types*'
17
17
  - '*eslint*'
@@ -116,7 +116,7 @@ packages:
116
116
  glob: 7.2.3
117
117
  infer-owner: 1.0.4
118
118
  lru-cache: 6.0.0
119
- minipass: 3.1.6
119
+ minipass: 3.3.3
120
120
  minipass-collect: 1.0.2
121
121
  minipass-flush: 1.0.5
122
122
  minipass-pipeline: 1.2.4
@@ -210,7 +210,7 @@ packages:
210
210
  resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==}
211
211
  engines: {node: '>= 8'}
212
212
  dependencies:
213
- minipass: 3.1.6
213
+ minipass: 3.3.3
214
214
  dev: false
215
215
  optional: true
216
216
 
@@ -369,7 +369,7 @@ packages:
369
369
  https-proxy-agent: 5.0.1
370
370
  is-lambda: 1.0.1
371
371
  lru-cache: 6.0.0
372
- minipass: 3.1.6
372
+ minipass: 3.3.3
373
373
  minipass-collect: 1.0.2
374
374
  minipass-fetch: 1.4.1
375
375
  minipass-flush: 1.0.5
@@ -394,7 +394,7 @@ packages:
394
394
  resolution: {integrity: sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==}
395
395
  engines: {node: '>= 8'}
396
396
  dependencies:
397
- minipass: 3.1.6
397
+ minipass: 3.3.3
398
398
  dev: false
399
399
  optional: true
400
400
 
@@ -402,7 +402,7 @@ packages:
402
402
  resolution: {integrity: sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==}
403
403
  engines: {node: '>=8'}
404
404
  dependencies:
405
- minipass: 3.1.6
405
+ minipass: 3.3.3
406
406
  minipass-sized: 1.0.3
407
407
  minizlib: 2.1.2
408
408
  optionalDependencies:
@@ -414,7 +414,7 @@ packages:
414
414
  resolution: {integrity: sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==}
415
415
  engines: {node: '>= 8'}
416
416
  dependencies:
417
- minipass: 3.1.6
417
+ minipass: 3.3.3
418
418
  dev: false
419
419
  optional: true
420
420
 
@@ -422,7 +422,7 @@ packages:
422
422
  resolution: {integrity: sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==}
423
423
  engines: {node: '>=8'}
424
424
  dependencies:
425
- minipass: 3.1.6
425
+ minipass: 3.3.3
426
426
  dev: false
427
427
  optional: true
428
428
 
@@ -430,12 +430,12 @@ packages:
430
430
  resolution: {integrity: sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==}
431
431
  engines: {node: '>=8'}
432
432
  dependencies:
433
- minipass: 3.1.6
433
+ minipass: 3.3.3
434
434
  dev: false
435
435
  optional: true
436
436
 
437
- /minipass/3.1.6:
438
- resolution: {integrity: sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ==}
437
+ /minipass/3.3.3:
438
+ resolution: {integrity: sha512-N0BOsdFAlNRfmwMhjAsLVWOk7Ljmeb39iqFlsV1At+jqRhSUP9yeof8FyJu4imaJiSUp8vQebWD/guZwGQC8iA==}
439
439
  engines: {node: '>=8'}
440
440
  dependencies:
441
441
  yallist: 4.0.0
@@ -446,7 +446,7 @@ packages:
446
446
  resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==}
447
447
  engines: {node: '>= 8'}
448
448
  dependencies:
449
- minipass: 3.1.6
449
+ minipass: 3.3.3
450
450
  yallist: 4.0.0
451
451
  dev: false
452
452
  optional: true
@@ -634,7 +634,7 @@ packages:
634
634
  resolution: {integrity: sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==}
635
635
  engines: {node: '>= 8'}
636
636
  dependencies:
637
- minipass: 3.1.6
637
+ minipass: 3.3.3
638
638
  dev: false
639
639
  optional: true
640
640
 
@@ -669,7 +669,7 @@ packages:
669
669
  dependencies:
670
670
  chownr: 2.0.0
671
671
  fs-minipass: 2.1.0
672
- minipass: 3.1.6
672
+ minipass: 3.3.3
673
673
  minizlib: 2.1.2
674
674
  mkdirp: 1.0.4
675
675
  yallist: 4.0.0
@@ -691,7 +691,7 @@ packages:
691
691
  optional: true
692
692
 
693
693
  /util-deprecate/1.0.2:
694
- resolution: {integrity: sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=}
694
+ resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
695
695
  dev: false
696
696
  optional: true
697
697
 
@@ -712,7 +712,7 @@ packages:
712
712
  optional: true
713
713
 
714
714
  /wrappy/1.0.2:
715
- resolution: {integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=}
715
+ resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
716
716
  dev: false
717
717
  optional: true
718
718
 
@@ -1,6 +1,6 @@
1
1
  The ISC License
2
2
 
3
- Copyright (c) npm, Inc. and Contributors
3
+ Copyright (c) 2017-2022 npm, Inc., Isaac Z. Schlueter, and Contributors
4
4
 
5
5
  Permission to use, copy, modify, and/or distribute this software for any
6
6
  purpose with or without fee is hereby granted, provided that the above
@@ -5,7 +5,6 @@ const proc = typeof process === 'object' && process ? process : {
5
5
  }
6
6
  const EE = require('events')
7
7
  const Stream = require('stream')
8
- const Yallist = require('yallist')
9
8
  const SD = require('string_decoder').StringDecoder
10
9
 
11
10
  const EOF = Symbol('EOF')
@@ -27,6 +26,12 @@ const BUFFERPUSH = Symbol('bufferPush')
27
26
  const BUFFERSHIFT = Symbol('bufferShift')
28
27
  const OBJECTMODE = Symbol('objectMode')
29
28
  const DESTROYED = Symbol('destroyed')
29
+ const EMITDATA = Symbol('emitData')
30
+ const EMITEND = Symbol('emitEnd')
31
+ const EMITEND2 = Symbol('emitEnd2')
32
+ const ASYNC = Symbol('async')
33
+
34
+ const defer = fn => Promise.resolve().then(fn)
30
35
 
31
36
  // TODO remove when Node v8 support drops
32
37
  const doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1'
@@ -51,14 +56,46 @@ const isArrayBuffer = b => b instanceof ArrayBuffer ||
51
56
 
52
57
  const isArrayBufferView = b => !Buffer.isBuffer(b) && ArrayBuffer.isView(b)
53
58
 
59
+ class Pipe {
60
+ constructor (src, dest, opts) {
61
+ this.src = src
62
+ this.dest = dest
63
+ this.opts = opts
64
+ this.ondrain = () => src[RESUME]()
65
+ dest.on('drain', this.ondrain)
66
+ }
67
+ unpipe () {
68
+ this.dest.removeListener('drain', this.ondrain)
69
+ }
70
+ // istanbul ignore next - only here for the prototype
71
+ proxyErrors () {}
72
+ end () {
73
+ this.unpipe()
74
+ if (this.opts.end)
75
+ this.dest.end()
76
+ }
77
+ }
78
+
79
+ class PipeProxyErrors extends Pipe {
80
+ unpipe () {
81
+ this.src.removeListener('error', this.proxyErrors)
82
+ super.unpipe()
83
+ }
84
+ constructor (src, dest, opts) {
85
+ super(src, dest, opts)
86
+ this.proxyErrors = er => dest.emit('error', er)
87
+ src.on('error', this.proxyErrors)
88
+ }
89
+ }
90
+
54
91
  module.exports = class Minipass extends Stream {
55
92
  constructor (options) {
56
93
  super()
57
94
  this[FLOWING] = false
58
95
  // whether we're explicitly paused
59
96
  this[PAUSED] = false
60
- this.pipes = new Yallist()
61
- this.buffer = new Yallist()
97
+ this.pipes = []
98
+ this.buffer = []
62
99
  this[OBJECTMODE] = options && options.objectMode || false
63
100
  if (this[OBJECTMODE])
64
101
  this[ENCODING] = null
@@ -66,6 +103,7 @@ module.exports = class Minipass extends Stream {
66
103
  this[ENCODING] = options && options.encoding || null
67
104
  if (this[ENCODING] === 'buffer')
68
105
  this[ENCODING] = null
106
+ this[ASYNC] = options && !!options.async || false
69
107
  this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null
70
108
  this[EOF] = false
71
109
  this[EMITTED_END] = false
@@ -105,6 +143,9 @@ module.exports = class Minipass extends Stream {
105
143
  get objectMode () { return this[OBJECTMODE] }
106
144
  set objectMode (om) { this[OBJECTMODE] = this[OBJECTMODE] || !!om }
107
145
 
146
+ get ['async'] () { return this[ASYNC] }
147
+ set ['async'] (a) { this[ASYNC] = this[ASYNC] || !!a }
148
+
108
149
  write (chunk, encoding, cb) {
109
150
  if (this[EOF])
110
151
  throw new Error('write after end')
@@ -123,6 +164,8 @@ module.exports = class Minipass extends Stream {
123
164
  if (!encoding)
124
165
  encoding = 'utf8'
125
166
 
167
+ const fn = this[ASYNC] ? defer : f => f()
168
+
126
169
  // convert array buffers and typed array views into buffers
127
170
  // at some point in the future, we may want to do the opposite!
128
171
  // leave strings and buffers as-is
@@ -137,19 +180,40 @@ module.exports = class Minipass extends Stream {
137
180
  this.objectMode = true
138
181
  }
139
182
 
140
- // this ensures at this point that the chunk is a buffer or string
183
+ // handle object mode up front, since it's simpler
184
+ // this yields better performance, fewer checks later.
185
+ if (this[OBJECTMODE]) {
186
+ /* istanbul ignore if - maybe impossible? */
187
+ if (this.flowing && this[BUFFERLENGTH] !== 0)
188
+ this[FLUSH](true)
189
+
190
+ if (this.flowing)
191
+ this.emit('data', chunk)
192
+ else
193
+ this[BUFFERPUSH](chunk)
194
+
195
+ if (this[BUFFERLENGTH] !== 0)
196
+ this.emit('readable')
197
+
198
+ if (cb)
199
+ fn(cb)
200
+
201
+ return this.flowing
202
+ }
203
+
204
+ // at this point the chunk is a buffer or string
141
205
  // don't buffer it up or send it to the decoder
142
- if (!this.objectMode && !chunk.length) {
206
+ if (!chunk.length) {
143
207
  if (this[BUFFERLENGTH] !== 0)
144
208
  this.emit('readable')
145
209
  if (cb)
146
- cb()
210
+ fn(cb)
147
211
  return this.flowing
148
212
  }
149
213
 
150
214
  // fast-path writing strings of same encoding to a stream with
151
215
  // an empty buffer, skipping the buffer/decoder dance
152
- if (typeof chunk === 'string' && !this[OBJECTMODE] &&
216
+ if (typeof chunk === 'string' &&
153
217
  // unless it is a string already ready for us to use
154
218
  !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) {
155
219
  chunk = Buffer.from(chunk, encoding)
@@ -158,27 +222,20 @@ module.exports = class Minipass extends Stream {
158
222
  if (Buffer.isBuffer(chunk) && this[ENCODING])
159
223
  chunk = this[DECODER].write(chunk)
160
224
 
161
- if (this.flowing) {
162
- // if we somehow have something in the buffer, but we think we're
163
- // flowing, then we need to flush all that out first, or we get
164
- // chunks coming in out of order. Can't emit 'drain' here though,
165
- // because we're mid-write, so that'd be bad.
166
- if (this[BUFFERLENGTH] !== 0)
167
- this[FLUSH](true)
225
+ // Note: flushing CAN potentially switch us into not-flowing mode
226
+ if (this.flowing && this[BUFFERLENGTH] !== 0)
227
+ this[FLUSH](true)
168
228
 
169
- // if we are still flowing after flushing the buffer we can emit the
170
- // chunk otherwise we have to buffer it.
171
- this.flowing
172
- ? this.emit('data', chunk)
173
- : this[BUFFERPUSH](chunk)
174
- } else
229
+ if (this.flowing)
230
+ this.emit('data', chunk)
231
+ else
175
232
  this[BUFFERPUSH](chunk)
176
233
 
177
234
  if (this[BUFFERLENGTH] !== 0)
178
235
  this.emit('readable')
179
236
 
180
237
  if (cb)
181
- cb()
238
+ fn(cb)
182
239
 
183
240
  return this.flowing
184
241
  }
@@ -187,35 +244,31 @@ module.exports = class Minipass extends Stream {
187
244
  if (this[DESTROYED])
188
245
  return null
189
246
 
190
- try {
191
- if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH])
192
- return null
247
+ if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) {
248
+ this[MAYBE_EMIT_END]()
249
+ return null
250
+ }
193
251
 
194
- if (this[OBJECTMODE])
195
- n = null
196
-
197
- if (this.buffer.length > 1 && !this[OBJECTMODE]) {
198
- if (this.encoding)
199
- this.buffer = new Yallist([
200
- Array.from(this.buffer).join('')
201
- ])
202
- else
203
- this.buffer = new Yallist([
204
- Buffer.concat(Array.from(this.buffer), this[BUFFERLENGTH])
205
- ])
206
- }
252
+ if (this[OBJECTMODE])
253
+ n = null
207
254
 
208
- return this[READ](n || null, this.buffer.head.value)
209
- } finally {
210
- this[MAYBE_EMIT_END]()
255
+ if (this.buffer.length > 1 && !this[OBJECTMODE]) {
256
+ if (this.encoding)
257
+ this.buffer = [this.buffer.join('')]
258
+ else
259
+ this.buffer = [Buffer.concat(this.buffer, this[BUFFERLENGTH])]
211
260
  }
261
+
262
+ const ret = this[READ](n || null, this.buffer[0])
263
+ this[MAYBE_EMIT_END]()
264
+ return ret
212
265
  }
213
266
 
214
267
  [READ] (n, chunk) {
215
268
  if (n === chunk.length || n === null)
216
269
  this[BUFFERSHIFT]()
217
270
  else {
218
- this.buffer.head.value = chunk.slice(n)
271
+ this.buffer[0] = chunk.slice(n)
219
272
  chunk = chunk.slice(0, n)
220
273
  this[BUFFERLENGTH] -= n
221
274
  }
@@ -291,7 +344,7 @@ module.exports = class Minipass extends Stream {
291
344
  this[BUFFERLENGTH] += 1
292
345
  else
293
346
  this[BUFFERLENGTH] += chunk.length
294
- return this.buffer.push(chunk)
347
+ this.buffer.push(chunk)
295
348
  }
296
349
 
297
350
  [BUFFERSHIFT] () {
@@ -299,7 +352,7 @@ module.exports = class Minipass extends Stream {
299
352
  if (this[OBJECTMODE])
300
353
  this[BUFFERLENGTH] -= 1
301
354
  else
302
- this[BUFFERLENGTH] -= this.buffer.head.value.length
355
+ this[BUFFERLENGTH] -= this.buffer[0].length
303
356
  }
304
357
  return this.buffer.shift()
305
358
  }
@@ -325,35 +378,52 @@ module.exports = class Minipass extends Stream {
325
378
  opts.end = false
326
379
  else
327
380
  opts.end = opts.end !== false
381
+ opts.proxyErrors = !!opts.proxyErrors
328
382
 
329
- const p = { dest: dest, opts: opts, ondrain: _ => this[RESUME]() }
330
- this.pipes.push(p)
331
-
332
- dest.on('drain', p.ondrain)
333
- this[RESUME]()
334
383
  // piping an ended stream ends immediately
335
- if (ended && p.opts.end)
336
- p.dest.end()
384
+ if (ended) {
385
+ if (opts.end)
386
+ dest.end()
387
+ } else {
388
+ this.pipes.push(!opts.proxyErrors ? new Pipe(this, dest, opts)
389
+ : new PipeProxyErrors(this, dest, opts))
390
+ if (this[ASYNC])
391
+ defer(() => this[RESUME]())
392
+ else
393
+ this[RESUME]()
394
+ }
395
+
337
396
  return dest
338
397
  }
339
398
 
399
+ unpipe (dest) {
400
+ const p = this.pipes.find(p => p.dest === dest)
401
+ if (p) {
402
+ this.pipes.splice(this.pipes.indexOf(p), 1)
403
+ p.unpipe()
404
+ }
405
+ }
406
+
340
407
  addListener (ev, fn) {
341
408
  return this.on(ev, fn)
342
409
  }
343
410
 
344
411
  on (ev, fn) {
345
- try {
346
- return super.on(ev, fn)
347
- } finally {
348
- if (ev === 'data' && !this.pipes.length && !this.flowing)
349
- this[RESUME]()
350
- else if (isEndish(ev) && this[EMITTED_END]) {
351
- super.emit(ev)
352
- this.removeAllListeners(ev)
353
- } else if (ev === 'error' && this[EMITTED_ERROR]) {
412
+ const ret = super.on(ev, fn)
413
+ if (ev === 'data' && !this.pipes.length && !this.flowing)
414
+ this[RESUME]()
415
+ else if (ev === 'readable' && this[BUFFERLENGTH] !== 0)
416
+ super.emit('readable')
417
+ else if (isEndish(ev) && this[EMITTED_END]) {
418
+ super.emit(ev)
419
+ this.removeAllListeners(ev)
420
+ } else if (ev === 'error' && this[EMITTED_ERROR]) {
421
+ if (this[ASYNC])
422
+ defer(() => fn.call(this, this[EMITTED_ERROR]))
423
+ else
354
424
  fn.call(this, this[EMITTED_ERROR])
355
- }
356
425
  }
426
+ return ret
357
427
  }
358
428
 
359
429
  get emittedEnd () {
@@ -376,65 +446,84 @@ module.exports = class Minipass extends Stream {
376
446
  }
377
447
  }
378
448
 
379
- emit (ev, data) {
449
+ emit (ev, data, ...extra) {
380
450
  // error and close are only events allowed after calling destroy()
381
451
  if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED])
382
452
  return
383
453
  else if (ev === 'data') {
384
- if (!data)
385
- return
386
-
387
- if (this.pipes.length)
388
- this.pipes.forEach(p =>
389
- p.dest.write(data) === false && this.pause())
454
+ return !data ? false
455
+ : this[ASYNC] ? defer(() => this[EMITDATA](data))
456
+ : this[EMITDATA](data)
390
457
  } else if (ev === 'end') {
391
- // only actual end gets this treatment
392
- if (this[EMITTED_END] === true)
393
- return
394
-
395
- this[EMITTED_END] = true
396
- this.readable = false
397
-
398
- if (this[DECODER]) {
399
- data = this[DECODER].end()
400
- if (data) {
401
- this.pipes.forEach(p => p.dest.write(data))
402
- super.emit('data', data)
403
- }
404
- }
405
-
406
- this.pipes.forEach(p => {
407
- p.dest.removeListener('drain', p.ondrain)
408
- if (p.opts.end)
409
- p.dest.end()
410
- })
458
+ return this[EMITEND]()
411
459
  } else if (ev === 'close') {
412
460
  this[CLOSED] = true
413
461
  // don't emit close before 'end' and 'finish'
414
462
  if (!this[EMITTED_END] && !this[DESTROYED])
415
463
  return
464
+ const ret = super.emit('close')
465
+ this.removeAllListeners('close')
466
+ return ret
416
467
  } else if (ev === 'error') {
417
468
  this[EMITTED_ERROR] = data
469
+ const ret = super.emit('error', data)
470
+ this[MAYBE_EMIT_END]()
471
+ return ret
472
+ } else if (ev === 'resume') {
473
+ const ret = super.emit('resume')
474
+ this[MAYBE_EMIT_END]()
475
+ return ret
476
+ } else if (ev === 'finish' || ev === 'prefinish') {
477
+ const ret = super.emit(ev)
478
+ this.removeAllListeners(ev)
479
+ return ret
418
480
  }
419
481
 
420
- // TODO: replace with a spread operator when Node v4 support drops
421
- const args = new Array(arguments.length)
422
- args[0] = ev
423
- args[1] = data
424
- if (arguments.length > 2) {
425
- for (let i = 2; i < arguments.length; i++) {
426
- args[i] = arguments[i]
482
+ // Some other unknown event
483
+ const ret = super.emit(ev, data, ...extra)
484
+ this[MAYBE_EMIT_END]()
485
+ return ret
486
+ }
487
+
488
+ [EMITDATA] (data) {
489
+ for (const p of this.pipes) {
490
+ if (p.dest.write(data) === false)
491
+ this.pause()
492
+ }
493
+ const ret = super.emit('data', data)
494
+ this[MAYBE_EMIT_END]()
495
+ return ret
496
+ }
497
+
498
+ [EMITEND] () {
499
+ if (this[EMITTED_END])
500
+ return
501
+
502
+ this[EMITTED_END] = true
503
+ this.readable = false
504
+ if (this[ASYNC])
505
+ defer(() => this[EMITEND2]())
506
+ else
507
+ this[EMITEND2]()
508
+ }
509
+
510
+ [EMITEND2] () {
511
+ if (this[DECODER]) {
512
+ const data = this[DECODER].end()
513
+ if (data) {
514
+ for (const p of this.pipes) {
515
+ p.dest.write(data)
516
+ }
517
+ super.emit('data', data)
427
518
  }
428
519
  }
429
520
 
430
- try {
431
- return super.emit.apply(this, args)
432
- } finally {
433
- if (!isEndish(ev))
434
- this[MAYBE_EMIT_END]()
435
- else
436
- this.removeAllListeners(ev)
521
+ for (const p of this.pipes) {
522
+ p.end()
437
523
  }
524
+ const ret = super.emit('end')
525
+ this.removeAllListeners('end')
526
+ return ret
438
527
  }
439
528
 
440
529
  // const all = await stream.collect()
@@ -536,7 +625,7 @@ module.exports = class Minipass extends Stream {
536
625
  this[DESTROYED] = true
537
626
 
538
627
  // throw away all buffered data, it's never coming out
539
- this.buffer = new Yallist()
628
+ this.buffer.length = 0
540
629
  this[BUFFERLENGTH] = 0
541
630
 
542
631
  if (typeof this.close === 'function' && !this[CLOSED])
@@ -1,15 +1,19 @@
1
1
  {
2
2
  "name": "minipass",
3
- "version": "3.1.6",
3
+ "version": "3.3.3",
4
4
  "description": "minimal implementation of a PassThrough stream",
5
5
  "main": "index.js",
6
6
  "dependencies": {
7
7
  "yallist": "^4.0.0"
8
8
  },
9
9
  "devDependencies": {
10
+ "@types/node": "^17.0.41",
10
11
  "end-of-stream": "^1.4.0",
11
- "tap": "^15.0.9",
12
- "through2": "^2.0.3"
12
+ "prettier": "^2.6.2",
13
+ "tap": "^16.2.0",
14
+ "through2": "^2.0.3",
15
+ "ts-node": "^10.8.1",
16
+ "typescript": "^4.7.3"
13
17
  },
14
18
  "scripts": {
15
19
  "test": "tap",
@@ -28,6 +32,7 @@
28
32
  "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
29
33
  "license": "ISC",
30
34
  "files": [
35
+ "index.d.ts",
31
36
  "index.js"
32
37
  ],
33
38
  "tap": {
@@ -35,5 +40,16 @@
35
40
  },
36
41
  "engines": {
37
42
  "node": ">=8"
43
+ },
44
+ "prettier": {
45
+ "semi": false,
46
+ "printWidth": 80,
47
+ "tabWidth": 2,
48
+ "useTabs": false,
49
+ "singleQuote": true,
50
+ "jsxSingleQuote": false,
51
+ "bracketSameLine": true,
52
+ "arrowParens": "avoid",
53
+ "endOfLine": "lf"
38
54
  }
39
55
  }