Skip to content

Commit 0a3fe00

Browse files
committed
deps: minipass@4.0.0
1 parent 6b77340 commit 0a3fe00

File tree

49 files changed

+4775
-2063
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+4775
-2063
lines changed

node_modules/.gitignore

+25-18
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@
5252
!/brace-expansion
5353
!/builtins
5454
!/cacache
55-
!/cacache/node_modules/
56-
/cacache/node_modules/*
57-
!/cacache/node_modules/minipass
5855
!/chalk
5956
!/chownr
6057
!/ci-info
@@ -88,6 +85,9 @@
8885
!/events
8986
!/fastest-levenshtein
9087
!/fs-minipass
88+
!/fs-minipass/node_modules/
89+
/fs-minipass/node_modules/*
90+
!/fs-minipass/node_modules/minipass
9191
!/fs.realpath
9292
!/function-bind
9393
!/gauge
@@ -136,18 +136,36 @@
136136
!/libnpmversion
137137
!/lru-cache
138138
!/make-fetch-happen
139-
!/make-fetch-happen/node_modules/
140-
/make-fetch-happen/node_modules/*
141-
!/make-fetch-happen/node_modules/minipass
142139
!/minimatch
143140
!/minipass-collect
141+
!/minipass-collect/node_modules/
142+
/minipass-collect/node_modules/*
143+
!/minipass-collect/node_modules/minipass
144144
!/minipass-fetch
145+
!/minipass-fetch/node_modules/
146+
/minipass-fetch/node_modules/*
147+
!/minipass-fetch/node_modules/minipass
145148
!/minipass-flush
149+
!/minipass-flush/node_modules/
150+
/minipass-flush/node_modules/*
151+
!/minipass-flush/node_modules/minipass
146152
!/minipass-json-stream
153+
!/minipass-json-stream/node_modules/
154+
/minipass-json-stream/node_modules/*
155+
!/minipass-json-stream/node_modules/minipass
147156
!/minipass-pipeline
157+
!/minipass-pipeline/node_modules/
158+
/minipass-pipeline/node_modules/*
159+
!/minipass-pipeline/node_modules/minipass
148160
!/minipass-sized
161+
!/minipass-sized/node_modules/
162+
/minipass-sized/node_modules/*
163+
!/minipass-sized/node_modules/minipass
149164
!/minipass
150165
!/minizlib
166+
!/minizlib/node_modules/
167+
/minizlib/node_modules/*
168+
!/minizlib/node_modules/minipass
151169
!/mkdirp
152170
!/ms
153171
!/mute-stream
@@ -173,6 +191,7 @@
173191
!/node-gyp/node_modules/make-fetch-happen
174192
!/node-gyp/node_modules/minimatch
175193
!/node-gyp/node_modules/minipass-fetch
194+
!/node-gyp/node_modules/minipass
176195
!/node-gyp/node_modules/nopt
177196
!/node-gyp/node_modules/npmlog
178197
!/node-gyp/node_modules/ssri
@@ -190,17 +209,11 @@
190209
!/npm-pick-manifest
191210
!/npm-profile
192211
!/npm-registry-fetch
193-
!/npm-registry-fetch/node_modules/
194-
/npm-registry-fetch/node_modules/*
195-
!/npm-registry-fetch/node_modules/minipass
196212
!/npm-user-validate
197213
!/npmlog
198214
!/once
199215
!/p-map
200216
!/pacote
201-
!/pacote/node_modules/
202-
/pacote/node_modules/*
203-
!/pacote/node_modules/minipass
204217
!/parse-conflict-json
205218
!/path-is-absolute
206219
!/postcss-selector-parser
@@ -240,17 +253,11 @@
240253
!/spdx-expression-parse
241254
!/spdx-license-ids
242255
!/ssri
243-
!/ssri/node_modules/
244-
/ssri/node_modules/*
245-
!/ssri/node_modules/minipass
246256
!/string_decoder
247257
!/string-width
248258
!/strip-ansi
249259
!/supports-color
250260
!/tar
251-
!/tar/node_modules/
252-
/tar/node_modules/*
253-
!/tar/node_modules/minipass
254261
!/text-table
255262
!/tiny-relative-date
256263
!/treeverse

node_modules/cacache/node_modules/minipass/index.d.ts node_modules/fs-minipass/node_modules/minipass/index.d.ts

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
/// <reference types="node" />
2-
3-
// Note: marking anything protected or private in the exported
4-
// class will limit Minipass's ability to be used as the base
5-
// for mixin classes.
62
import { EventEmitter } from 'events'
73
import { Stream } from 'stream'
84

@@ -20,6 +16,12 @@ declare namespace Minipass {
2016
pipe(): any
2117
}
2218

19+
interface Pipe<R, W> {
20+
src: Minipass<R, W>
21+
dest: Writable
22+
opts: PipeOptions
23+
}
24+
2325
type DualIterable<T> = Iterable<T> & AsyncIterable<T>
2426

2527
type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string
@@ -74,6 +76,12 @@ declare class Minipass<
7476
readonly emittedEnd: boolean
7577
readonly destroyed: boolean
7678

79+
/**
80+
* Not technically private or readonly, but not safe to mutate.
81+
*/
82+
private readonly buffer: RType[]
83+
private readonly pipes: Minipass.Pipe<RType, WType>[]
84+
7785
/**
7886
* Technically writable, but mutating it can change the type,
7987
* so is not safe to do in TypeScript.

node_modules/make-fetch-happen/node_modules/minipass/index.js node_modules/fs-minipass/node_modules/minipass/index.js

+25-33
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ const DECODER = Symbol('decoder')
2121
const FLOWING = Symbol('flowing')
2222
const PAUSED = Symbol('paused')
2323
const RESUME = Symbol('resume')
24-
const BUFFER = Symbol('buffer')
25-
const PIPES = Symbol('pipes')
2624
const BUFFERLENGTH = Symbol('bufferLength')
2725
const BUFFERPUSH = Symbol('bufferPush')
2826
const BUFFERSHIFT = Symbol('bufferShift')
@@ -96,8 +94,8 @@ module.exports = class Minipass extends Stream {
9694
this[FLOWING] = false
9795
// whether we're explicitly paused
9896
this[PAUSED] = false
99-
this[PIPES] = []
100-
this[BUFFER] = []
97+
this.pipes = []
98+
this.buffer = []
10199
this[OBJECTMODE] = options && options.objectMode || false
102100
if (this[OBJECTMODE])
103101
this[ENCODING] = null
@@ -116,12 +114,6 @@ module.exports = class Minipass extends Stream {
116114
this.readable = true
117115
this[BUFFERLENGTH] = 0
118116
this[DESTROYED] = false
119-
if (options && options.debugExposeBuffer === true) {
120-
Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] })
121-
}
122-
if (options && options.debugExposePipes === true) {
123-
Object.defineProperty(this, 'pipes', { get: () => this[PIPES] })
124-
}
125117
}
126118

127119
get bufferLength () { return this[BUFFERLENGTH] }
@@ -137,8 +129,8 @@ module.exports = class Minipass extends Stream {
137129

138130
if (this[ENCODING] !== enc) {
139131
this[DECODER] = enc ? new SD(enc) : null
140-
if (this[BUFFER].length)
141-
this[BUFFER] = this[BUFFER].map(chunk => this[DECODER].write(chunk))
132+
if (this.buffer.length)
133+
this.buffer = this.buffer.map(chunk => this[DECODER].write(chunk))
142134
}
143135

144136
this[ENCODING] = enc
@@ -260,14 +252,14 @@ module.exports = class Minipass extends Stream {
260252
if (this[OBJECTMODE])
261253
n = null
262254

263-
if (this[BUFFER].length > 1 && !this[OBJECTMODE]) {
255+
if (this.buffer.length > 1 && !this[OBJECTMODE]) {
264256
if (this.encoding)
265-
this[BUFFER] = [this[BUFFER].join('')]
257+
this.buffer = [this.buffer.join('')]
266258
else
267-
this[BUFFER] = [Buffer.concat(this[BUFFER], this[BUFFERLENGTH])]
259+
this.buffer = [Buffer.concat(this.buffer, this[BUFFERLENGTH])]
268260
}
269261

270-
const ret = this[READ](n || null, this[BUFFER][0])
262+
const ret = this[READ](n || null, this.buffer[0])
271263
this[MAYBE_EMIT_END]()
272264
return ret
273265
}
@@ -276,14 +268,14 @@ module.exports = class Minipass extends Stream {
276268
if (n === chunk.length || n === null)
277269
this[BUFFERSHIFT]()
278270
else {
279-
this[BUFFER][0] = chunk.slice(n)
271+
this.buffer[0] = chunk.slice(n)
280272
chunk = chunk.slice(0, n)
281273
this[BUFFERLENGTH] -= n
282274
}
283275

284276
this.emit('data', chunk)
285277

286-
if (!this[BUFFER].length && !this[EOF])
278+
if (!this.buffer.length && !this[EOF])
287279
this.emit('drain')
288280

289281
return chunk
@@ -318,7 +310,7 @@ module.exports = class Minipass extends Stream {
318310
this[PAUSED] = false
319311
this[FLOWING] = true
320312
this.emit('resume')
321-
if (this[BUFFER].length)
313+
if (this.buffer.length)
322314
this[FLUSH]()
323315
else if (this[EOF])
324316
this[MAYBE_EMIT_END]()
@@ -352,23 +344,23 @@ module.exports = class Minipass extends Stream {
352344
this[BUFFERLENGTH] += 1
353345
else
354346
this[BUFFERLENGTH] += chunk.length
355-
this[BUFFER].push(chunk)
347+
this.buffer.push(chunk)
356348
}
357349

358350
[BUFFERSHIFT] () {
359-
if (this[BUFFER].length) {
351+
if (this.buffer.length) {
360352
if (this[OBJECTMODE])
361353
this[BUFFERLENGTH] -= 1
362354
else
363-
this[BUFFERLENGTH] -= this[BUFFER][0].length
355+
this[BUFFERLENGTH] -= this.buffer[0].length
364356
}
365-
return this[BUFFER].shift()
357+
return this.buffer.shift()
366358
}
367359

368360
[FLUSH] (noDrain) {
369361
do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]()))
370362

371-
if (!noDrain && !this[BUFFER].length && !this[EOF])
363+
if (!noDrain && !this.buffer.length && !this[EOF])
372364
this.emit('drain')
373365
}
374366

@@ -393,7 +385,7 @@ module.exports = class Minipass extends Stream {
393385
if (opts.end)
394386
dest.end()
395387
} else {
396-
this[PIPES].push(!opts.proxyErrors ? new Pipe(this, dest, opts)
388+
this.pipes.push(!opts.proxyErrors ? new Pipe(this, dest, opts)
397389
: new PipeProxyErrors(this, dest, opts))
398390
if (this[ASYNC])
399391
defer(() => this[RESUME]())
@@ -405,9 +397,9 @@ module.exports = class Minipass extends Stream {
405397
}
406398

407399
unpipe (dest) {
408-
const p = this[PIPES].find(p => p.dest === dest)
400+
const p = this.pipes.find(p => p.dest === dest)
409401
if (p) {
410-
this[PIPES].splice(this[PIPES].indexOf(p), 1)
402+
this.pipes.splice(this.pipes.indexOf(p), 1)
411403
p.unpipe()
412404
}
413405
}
@@ -418,7 +410,7 @@ module.exports = class Minipass extends Stream {
418410

419411
on (ev, fn) {
420412
const ret = super.on(ev, fn)
421-
if (ev === 'data' && !this[PIPES].length && !this.flowing)
413+
if (ev === 'data' && !this.pipes.length && !this.flowing)
422414
this[RESUME]()
423415
else if (ev === 'readable' && this[BUFFERLENGTH] !== 0)
424416
super.emit('readable')
@@ -442,7 +434,7 @@ module.exports = class Minipass extends Stream {
442434
if (!this[EMITTING_END] &&
443435
!this[EMITTED_END] &&
444436
!this[DESTROYED] &&
445-
this[BUFFER].length === 0 &&
437+
this.buffer.length === 0 &&
446438
this[EOF]) {
447439
this[EMITTING_END] = true
448440
this.emit('end')
@@ -494,7 +486,7 @@ module.exports = class Minipass extends Stream {
494486
}
495487

496488
[EMITDATA] (data) {
497-
for (const p of this[PIPES]) {
489+
for (const p of this.pipes) {
498490
if (p.dest.write(data) === false)
499491
this.pause()
500492
}
@@ -519,14 +511,14 @@ module.exports = class Minipass extends Stream {
519511
if (this[DECODER]) {
520512
const data = this[DECODER].end()
521513
if (data) {
522-
for (const p of this[PIPES]) {
514+
for (const p of this.pipes) {
523515
p.dest.write(data)
524516
}
525517
super.emit('data', data)
526518
}
527519
}
528520

529-
for (const p of this[PIPES]) {
521+
for (const p of this.pipes) {
530522
p.end()
531523
}
532524
const ret = super.emit('end')
@@ -633,7 +625,7 @@ module.exports = class Minipass extends Stream {
633625
this[DESTROYED] = true
634626

635627
// throw away all buffered data, it's never coming out
636-
this[BUFFER].length = 0
628+
this.buffer.length = 0
637629
this[BUFFERLENGTH] = 0
638630

639631
if (typeof this.close === 'function' && !this[CLOSED])

node_modules/make-fetch-happen/node_modules/minipass/package.json node_modules/fs-minipass/node_modules/minipass/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "minipass",
3-
"version": "4.0.0",
3+
"version": "3.3.6",
44
"description": "minimal implementation of a PassThrough stream",
55
"main": "index.js",
66
"types": "index.d.ts",

node_modules/npm-registry-fetch/node_modules/minipass/index.d.ts node_modules/minipass-collect/node_modules/minipass/index.d.ts

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
/// <reference types="node" />
2-
3-
// Note: marking anything protected or private in the exported
4-
// class will limit Minipass's ability to be used as the base
5-
// for mixin classes.
62
import { EventEmitter } from 'events'
73
import { Stream } from 'stream'
84

@@ -20,6 +16,12 @@ declare namespace Minipass {
2016
pipe(): any
2117
}
2218

19+
interface Pipe<R, W> {
20+
src: Minipass<R, W>
21+
dest: Writable
22+
opts: PipeOptions
23+
}
24+
2325
type DualIterable<T> = Iterable<T> & AsyncIterable<T>
2426

2527
type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string
@@ -74,6 +76,12 @@ declare class Minipass<
7476
readonly emittedEnd: boolean
7577
readonly destroyed: boolean
7678

79+
/**
80+
* Not technically private or readonly, but not safe to mutate.
81+
*/
82+
private readonly buffer: RType[]
83+
private readonly pipes: Minipass.Pipe<RType, WType>[]
84+
7785
/**
7886
* Technically writable, but mutating it can change the type,
7987
* so is not safe to do in TypeScript.

0 commit comments

Comments
 (0)