muhammara 2.2.0 → 2.5.0
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.
- package/CHANGELOG.md +30 -1
- package/README.md +2 -2
- package/muhammara.d.ts +258 -241
- package/muhammara.js +1 -1
- package/node_modules/@mapbox/node-pre-gyp/CHANGELOG.md +4 -0
- package/node_modules/@mapbox/node-pre-gyp/lib/util/versioning.js +1 -1
- package/node_modules/@mapbox/node-pre-gyp/package.json +10 -10
- package/node_modules/concat-map/package.json +1 -1
- package/node_modules/console-control-strings/package.json +1 -1
- package/node_modules/debug/README.md +3 -0
- package/node_modules/debug/package.json +5 -5
- package/node_modules/debug/src/common.js +1 -1
- package/node_modules/delegates/package.json +1 -1
- package/node_modules/detect-libc/README.md +124 -42
- package/node_modules/detect-libc/index.d.ts +11 -0
- package/node_modules/detect-libc/lib/detect-libc.js +166 -80
- package/node_modules/detect-libc/lib/process.js +16 -0
- package/node_modules/detect-libc/package.json +20 -19
- package/node_modules/fs.realpath/package.json +1 -1
- package/node_modules/glob/common.js +2 -0
- package/node_modules/glob/glob.js +4 -1
- package/node_modules/glob/package.json +9 -6
- package/node_modules/glob/sync.js +6 -3
- package/node_modules/has-unicode/package.json +1 -1
- package/node_modules/https-proxy-agent/dist/agent.js +2 -5
- package/node_modules/https-proxy-agent/dist/agent.js.map +1 -1
- package/node_modules/https-proxy-agent/package.json +5 -5
- package/node_modules/inflight/package.json +1 -1
- package/node_modules/minimatch/package.json +5 -5
- package/node_modules/minipass/LICENSE +1 -1
- package/node_modules/minipass/README.md +122 -7
- package/node_modules/minipass/index.d.ts +149 -0
- package/node_modules/minipass/index.js +191 -102
- package/node_modules/minipass/package.json +23 -7
- package/node_modules/node-fetch/package.json +5 -5
- package/node_modules/object-assign/package.json +1 -1
- package/node_modules/once/package.json +1 -1
- package/node_modules/path-is-absolute/package.json +1 -1
- package/node_modules/semver/README.md +3 -1
- package/node_modules/semver/bin/semver.js +19 -9
- package/node_modules/semver/classes/comparator.js +3 -2
- package/node_modules/semver/classes/index.js +1 -1
- package/node_modules/semver/classes/range.js +31 -22
- package/node_modules/semver/classes/semver.js +1 -1
- package/node_modules/semver/functions/cmp.js +8 -4
- package/node_modules/semver/functions/coerce.js +3 -2
- package/node_modules/semver/functions/inc.js +4 -1
- package/node_modules/semver/functions/parse.js +1 -1
- package/node_modules/semver/internal/constants.js +2 -2
- package/node_modules/semver/internal/identifiers.js +1 -1
- package/node_modules/semver/internal/parse-options.js +3 -3
- package/node_modules/semver/internal/re.js +3 -3
- package/node_modules/semver/package.json +46 -13
- package/node_modules/semver/ranges/min-version.js +2 -1
- package/node_modules/semver/ranges/outside.js +1 -1
- package/node_modules/semver/ranges/simplify.js +15 -12
- package/node_modules/semver/ranges/subset.js +53 -31
- package/node_modules/set-blocking/package.json +1 -1
- package/node_modules/tr46/package.json +1 -1
- package/node_modules/util-deprecate/package.json +1 -1
- package/node_modules/webidl-conversions/package.json +1 -1
- package/node_modules/whatwg-url/package.json +1 -1
- package/node_modules/wrappy/package.json +1 -1
- package/package.json +2 -1
- package/src/DocumentCopyingContextDriver.cpp +15 -15
- package/src/ObjectsContextDriver.cpp +1 -1
- package/node_modules/detect-libc/.npmignore +0 -7
- package/node_modules/detect-libc/bin/detect-libc.js +0 -18
- package/node_modules/semver/CHANGELOG.md +0 -111
|
@@ -1,34 +1,31 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_from": "detect-libc@^
|
|
3
|
-
"_id": "detect-libc@
|
|
2
|
+
"_from": "detect-libc@^2.0.0",
|
|
3
|
+
"_id": "detect-libc@2.0.1",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "
|
|
5
|
+
"_integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==",
|
|
6
6
|
"_location": "/detect-libc",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
9
9
|
"type": "range",
|
|
10
10
|
"registry": true,
|
|
11
|
-
"raw": "detect-libc@^
|
|
11
|
+
"raw": "detect-libc@^2.0.0",
|
|
12
12
|
"name": "detect-libc",
|
|
13
13
|
"escapedName": "detect-libc",
|
|
14
|
-
"rawSpec": "^
|
|
14
|
+
"rawSpec": "^2.0.0",
|
|
15
15
|
"saveSpec": null,
|
|
16
|
-
"fetchSpec": "^
|
|
16
|
+
"fetchSpec": "^2.0.0"
|
|
17
17
|
},
|
|
18
18
|
"_requiredBy": [
|
|
19
19
|
"/@mapbox/node-pre-gyp"
|
|
20
20
|
],
|
|
21
|
-
"_resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-
|
|
22
|
-
"_shasum": "
|
|
23
|
-
"_spec": "detect-libc@^
|
|
21
|
+
"_resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz",
|
|
22
|
+
"_shasum": "e1897aa88fa6ad197862937fbc0441ef352ee0cd",
|
|
23
|
+
"_spec": "detect-libc@^2.0.0",
|
|
24
24
|
"_where": "/home/runner/work/MuhammaraJS/MuhammaraJS/node_modules/@mapbox/node-pre-gyp",
|
|
25
25
|
"author": {
|
|
26
26
|
"name": "Lovell Fuller",
|
|
27
27
|
"email": "npm@lovell.info"
|
|
28
28
|
},
|
|
29
|
-
"bin": {
|
|
30
|
-
"detect-libc": "bin/detect-libc.js"
|
|
31
|
-
},
|
|
32
29
|
"bugs": {
|
|
33
30
|
"url": "https://github.com/lovell/detect-libc/issues"
|
|
34
31
|
},
|
|
@@ -42,14 +39,18 @@
|
|
|
42
39
|
"deprecated": false,
|
|
43
40
|
"description": "Node.js module to detect the C standard library (libc) implementation family and version",
|
|
44
41
|
"devDependencies": {
|
|
45
|
-
"ava": "^
|
|
46
|
-
"nyc": "^
|
|
47
|
-
"proxyquire": "^1.
|
|
48
|
-
"semistandard": "^
|
|
42
|
+
"ava": "^2.4.0",
|
|
43
|
+
"nyc": "^15.1.0",
|
|
44
|
+
"proxyquire": "^2.1.3",
|
|
45
|
+
"semistandard": "^14.2.3"
|
|
49
46
|
},
|
|
50
47
|
"engines": {
|
|
51
|
-
"node": ">=
|
|
48
|
+
"node": ">=8"
|
|
52
49
|
},
|
|
50
|
+
"files": [
|
|
51
|
+
"lib/",
|
|
52
|
+
"index.d.ts"
|
|
53
|
+
],
|
|
53
54
|
"homepage": "https://github.com/lovell/detect-libc#readme",
|
|
54
55
|
"keywords": [
|
|
55
56
|
"libc",
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
"url": "git://github.com/lovell/detect-libc.git"
|
|
65
66
|
},
|
|
66
67
|
"scripts": {
|
|
67
|
-
"test": "semistandard && nyc --reporter=lcov ava"
|
|
68
|
+
"test": "semistandard && nyc --reporter=lcov --check-coverage --branches=100 ava test/unit.js"
|
|
68
69
|
},
|
|
69
|
-
"version": "
|
|
70
|
+
"version": "2.0.1"
|
|
70
71
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"_from": "fs.realpath@^1.0.0",
|
|
3
3
|
"_id": "fs.realpath@1.0.0",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "
|
|
5
|
+
"_integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
|
|
6
6
|
"_location": "/fs.realpath",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -110,6 +110,8 @@ function setopts (self, pattern, options) {
|
|
|
110
110
|
// Note that they are not supported in Glob itself anyway.
|
|
111
111
|
options.nonegate = true
|
|
112
112
|
options.nocomment = true
|
|
113
|
+
// always treat \ in patterns as escapes, not path separators
|
|
114
|
+
options.allowWindowsEscape = false
|
|
113
115
|
|
|
114
116
|
self.minimatch = new Minimatch(pattern, options)
|
|
115
117
|
self.options = self.minimatch.options
|
|
@@ -342,7 +342,10 @@ Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
|
|
|
342
342
|
var read
|
|
343
343
|
if (prefix === null)
|
|
344
344
|
read = '.'
|
|
345
|
-
else if (isAbsolute(prefix) ||
|
|
345
|
+
else if (isAbsolute(prefix) ||
|
|
346
|
+
isAbsolute(pattern.map(function (p) {
|
|
347
|
+
return typeof p === 'string' ? p : '[*]'
|
|
348
|
+
}).join('/'))) {
|
|
346
349
|
if (!prefix || !isAbsolute(prefix))
|
|
347
350
|
prefix = '/' + prefix
|
|
348
351
|
read = prefix
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "glob@^7.1.3",
|
|
3
|
-
"_id": "glob@7.2.
|
|
3
|
+
"_id": "glob@7.2.3",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
|
|
6
6
|
"_location": "/glob",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"_requiredBy": [
|
|
19
19
|
"/rimraf"
|
|
20
20
|
],
|
|
21
|
-
"_resolved": "https://registry.npmjs.org/glob/-/glob-7.2.
|
|
22
|
-
"_shasum": "
|
|
21
|
+
"_resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
|
22
|
+
"_shasum": "b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b",
|
|
23
23
|
"_spec": "glob@^7.1.3",
|
|
24
24
|
"_where": "/home/runner/work/MuhammaraJS/MuhammaraJS/node_modules/rimraf",
|
|
25
25
|
"author": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"fs.realpath": "^1.0.0",
|
|
36
36
|
"inflight": "^1.0.4",
|
|
37
37
|
"inherits": "2",
|
|
38
|
-
"minimatch": "^3.
|
|
38
|
+
"minimatch": "^3.1.1",
|
|
39
39
|
"once": "^1.3.0",
|
|
40
40
|
"path-is-absolute": "^1.0.0"
|
|
41
41
|
},
|
|
@@ -63,6 +63,9 @@
|
|
|
63
63
|
"license": "ISC",
|
|
64
64
|
"main": "glob.js",
|
|
65
65
|
"name": "glob",
|
|
66
|
+
"publishConfig": {
|
|
67
|
+
"tag": "v7-legacy"
|
|
68
|
+
},
|
|
66
69
|
"repository": {
|
|
67
70
|
"type": "git",
|
|
68
71
|
"url": "git://github.com/isaacs/node-glob.git"
|
|
@@ -81,5 +84,5 @@
|
|
|
81
84
|
"after": "test/zz-cleanup.js",
|
|
82
85
|
"jobs": 1
|
|
83
86
|
},
|
|
84
|
-
"version": "7.2.
|
|
87
|
+
"version": "7.2.3"
|
|
85
88
|
}
|
|
@@ -48,7 +48,7 @@ function GlobSync (pattern, options) {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
GlobSync.prototype._finish = function () {
|
|
51
|
-
assert(this instanceof GlobSync)
|
|
51
|
+
assert.ok(this instanceof GlobSync)
|
|
52
52
|
if (this.realpath) {
|
|
53
53
|
var self = this
|
|
54
54
|
this.matches.forEach(function (matchset, index) {
|
|
@@ -72,7 +72,7 @@ GlobSync.prototype._finish = function () {
|
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
GlobSync.prototype._process = function (pattern, index, inGlobStar) {
|
|
75
|
-
assert(this instanceof GlobSync)
|
|
75
|
+
assert.ok(this instanceof GlobSync)
|
|
76
76
|
|
|
77
77
|
// Get the first [n] parts of pattern that are all strings.
|
|
78
78
|
var n = 0
|
|
@@ -109,7 +109,10 @@ GlobSync.prototype._process = function (pattern, index, inGlobStar) {
|
|
|
109
109
|
var read
|
|
110
110
|
if (prefix === null)
|
|
111
111
|
read = '.'
|
|
112
|
-
else if (isAbsolute(prefix) ||
|
|
112
|
+
else if (isAbsolute(prefix) ||
|
|
113
|
+
isAbsolute(pattern.map(function (p) {
|
|
114
|
+
return typeof p === 'string' ? p : '[*]'
|
|
115
|
+
}).join('/'))) {
|
|
113
116
|
if (!prefix || !isAbsolute(prefix))
|
|
114
117
|
prefix = '/' + prefix
|
|
115
118
|
read = prefix
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"_from": "has-unicode@^2.0.1",
|
|
3
3
|
"_id": "has-unicode@2.0.1",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "
|
|
5
|
+
"_integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==",
|
|
6
6
|
"_location": "/has-unicode",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -118,13 +118,10 @@ class HttpsProxyAgent extends agent_base_1.Agent {
|
|
|
118
118
|
if (statusCode === 200) {
|
|
119
119
|
req.once('socket', resume);
|
|
120
120
|
if (opts.secureEndpoint) {
|
|
121
|
-
const servername = opts.servername || opts.host;
|
|
122
|
-
if (!servername) {
|
|
123
|
-
throw new Error('Could not determine "servername"');
|
|
124
|
-
}
|
|
125
121
|
// The proxy is connecting to a TLS server, so upgrade
|
|
126
122
|
// this socket connection to a TLS connection.
|
|
127
123
|
debug('Upgrading socket connection to TLS');
|
|
124
|
+
const servername = opts.servername || opts.host;
|
|
128
125
|
return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket,
|
|
129
126
|
servername }));
|
|
130
127
|
}
|
|
@@ -141,7 +138,7 @@ class HttpsProxyAgent extends agent_base_1.Agent {
|
|
|
141
138
|
//
|
|
142
139
|
// See: https://hackerone.com/reports/541502
|
|
143
140
|
socket.destroy();
|
|
144
|
-
const fakeSocket = new net_1.default.Socket();
|
|
141
|
+
const fakeSocket = new net_1.default.Socket({ writable: false });
|
|
145
142
|
fakeSocket.readable = true;
|
|
146
143
|
// Need to wait for the "socket" event to re-play the "data" events.
|
|
147
144
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|
5
|
+
"_integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",
|
|
6
6
|
"_location": "/https-proxy-agent",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"_requiredBy": [
|
|
19
19
|
"/@mapbox/node-pre-gyp"
|
|
20
20
|
],
|
|
21
|
-
"_resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.
|
|
22
|
-
"_shasum": "
|
|
21
|
+
"_resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
|
|
22
|
+
"_shasum": "c59ef224a04fe8b754f3db0063a25ea30d0005d6",
|
|
23
23
|
"_spec": "https-proxy-agent@^5.0.0",
|
|
24
24
|
"_where": "/home/runner/work/MuhammaraJS/MuhammaraJS/node_modules/@mapbox/node-pre-gyp",
|
|
25
25
|
"author": {
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"test-lint": "eslint src --ext .js,.ts"
|
|
83
83
|
},
|
|
84
84
|
"types": "dist/index",
|
|
85
|
-
"version": "5.0.
|
|
85
|
+
"version": "5.0.1"
|
|
86
86
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"_from": "inflight@^1.0.4",
|
|
3
3
|
"_id": "inflight@1.0.6",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "
|
|
5
|
+
"_integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
|
|
6
6
|
"_location": "/inflight",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_from": "minimatch@^3.
|
|
2
|
+
"_from": "minimatch@^3.1.1",
|
|
3
3
|
"_id": "minimatch@3.1.2",
|
|
4
4
|
"_inBundle": false,
|
|
5
5
|
"_integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
|
@@ -8,19 +8,19 @@
|
|
|
8
8
|
"_requested": {
|
|
9
9
|
"type": "range",
|
|
10
10
|
"registry": true,
|
|
11
|
-
"raw": "minimatch@^3.
|
|
11
|
+
"raw": "minimatch@^3.1.1",
|
|
12
12
|
"name": "minimatch",
|
|
13
13
|
"escapedName": "minimatch",
|
|
14
|
-
"rawSpec": "^3.
|
|
14
|
+
"rawSpec": "^3.1.1",
|
|
15
15
|
"saveSpec": null,
|
|
16
|
-
"fetchSpec": "^3.
|
|
16
|
+
"fetchSpec": "^3.1.1"
|
|
17
17
|
},
|
|
18
18
|
"_requiredBy": [
|
|
19
19
|
"/glob"
|
|
20
20
|
],
|
|
21
21
|
"_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
|
22
22
|
"_shasum": "19cd194bfd3e428f049a70817c038d89ab4be35b",
|
|
23
|
-
"_spec": "minimatch@^3.
|
|
23
|
+
"_spec": "minimatch@^3.1.1",
|
|
24
24
|
"_where": "/home/runner/work/MuhammaraJS/MuhammaraJS/node_modules/glob",
|
|
25
25
|
"author": {
|
|
26
26
|
"name": "Isaac Z. Schlueter",
|
|
@@ -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
|
|
@@ -17,9 +17,6 @@ from this stream via `'data'` events or by calling `pipe()` into some other
|
|
|
17
17
|
stream. Calling `read()` requires the buffer to be flattened in some
|
|
18
18
|
cases, which requires copying memory.
|
|
19
19
|
|
|
20
|
-
There is also no `unpipe()` method. Once you start piping, there is no
|
|
21
|
-
stopping it!
|
|
22
|
-
|
|
23
20
|
If you set `objectMode: true` in the options, then whatever is written will
|
|
24
21
|
be emitted. Otherwise, it'll do a minimal amount of Buffer copying to
|
|
25
22
|
ensure proper Streams semantics when `read(n)` is called.
|
|
@@ -63,6 +60,10 @@ some ways superior to) Node.js core streams.
|
|
|
63
60
|
Please read these caveats if you are familiar with node-core streams and
|
|
64
61
|
intend to use Minipass streams in your programs.
|
|
65
62
|
|
|
63
|
+
You can avoid most of these differences entirely (for a very
|
|
64
|
+
small performance penalty) by setting `{async: true}` in the
|
|
65
|
+
constructor options.
|
|
66
|
+
|
|
66
67
|
### Timing
|
|
67
68
|
|
|
68
69
|
Minipass streams are designed to support synchronous use-cases. Thus, data
|
|
@@ -82,6 +83,82 @@ This non-deferring approach makes Minipass streams much easier to reason
|
|
|
82
83
|
about, especially in the context of Promises and other flow-control
|
|
83
84
|
mechanisms.
|
|
84
85
|
|
|
86
|
+
Example:
|
|
87
|
+
|
|
88
|
+
```js
|
|
89
|
+
const Minipass = require('minipass')
|
|
90
|
+
const stream = new Minipass({ async: true })
|
|
91
|
+
stream.on('data', () => console.log('data event'))
|
|
92
|
+
console.log('before write')
|
|
93
|
+
stream.write('hello')
|
|
94
|
+
console.log('after write')
|
|
95
|
+
// output:
|
|
96
|
+
// before write
|
|
97
|
+
// data event
|
|
98
|
+
// after write
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Exception: Async Opt-In
|
|
102
|
+
|
|
103
|
+
If you wish to have a Minipass stream with behavior that more
|
|
104
|
+
closely mimics Node.js core streams, you can set the stream in
|
|
105
|
+
async mode either by setting `async: true` in the constructor
|
|
106
|
+
options, or by setting `stream.async = true` later on.
|
|
107
|
+
|
|
108
|
+
```js
|
|
109
|
+
const Minipass = require('minipass')
|
|
110
|
+
const asyncStream = new Minipass({ async: true })
|
|
111
|
+
asyncStream.on('data', () => console.log('data event'))
|
|
112
|
+
console.log('before write')
|
|
113
|
+
asyncStream.write('hello')
|
|
114
|
+
console.log('after write')
|
|
115
|
+
// output:
|
|
116
|
+
// before write
|
|
117
|
+
// after write
|
|
118
|
+
// data event <-- this is deferred until the next tick
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Switching _out_ of async mode is unsafe, as it could cause data
|
|
122
|
+
corruption, and so is not enabled. Example:
|
|
123
|
+
|
|
124
|
+
```js
|
|
125
|
+
const Minipass = require('minipass')
|
|
126
|
+
const stream = new Minipass({ encoding: 'utf8' })
|
|
127
|
+
stream.on('data', chunk => console.log(chunk))
|
|
128
|
+
stream.async = true
|
|
129
|
+
console.log('before writes')
|
|
130
|
+
stream.write('hello')
|
|
131
|
+
setStreamSyncAgainSomehow(stream) // <-- this doesn't actually exist!
|
|
132
|
+
stream.write('world')
|
|
133
|
+
console.log('after writes')
|
|
134
|
+
// hypothetical output would be:
|
|
135
|
+
// before writes
|
|
136
|
+
// world
|
|
137
|
+
// after writes
|
|
138
|
+
// hello
|
|
139
|
+
// NOT GOOD!
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
To avoid this problem, once set into async mode, any attempt to
|
|
143
|
+
make the stream sync again will be ignored.
|
|
144
|
+
|
|
145
|
+
```js
|
|
146
|
+
const Minipass = require('minipass')
|
|
147
|
+
const stream = new Minipass({ encoding: 'utf8' })
|
|
148
|
+
stream.on('data', chunk => console.log(chunk))
|
|
149
|
+
stream.async = true
|
|
150
|
+
console.log('before writes')
|
|
151
|
+
stream.write('hello')
|
|
152
|
+
stream.async = false // <-- no-op, stream already async
|
|
153
|
+
stream.write('world')
|
|
154
|
+
console.log('after writes')
|
|
155
|
+
// actual output:
|
|
156
|
+
// before writes
|
|
157
|
+
// after writes
|
|
158
|
+
// hello
|
|
159
|
+
// world
|
|
160
|
+
```
|
|
161
|
+
|
|
85
162
|
### No High/Low Water Marks
|
|
86
163
|
|
|
87
164
|
Node.js core streams will optimistically fill up a buffer, returning `true`
|
|
@@ -97,6 +174,9 @@ If the data has nowhere to go, then `write()` returns false, and the data
|
|
|
97
174
|
sits in a buffer, to be drained out immediately as soon as anyone consumes
|
|
98
175
|
it.
|
|
99
176
|
|
|
177
|
+
Since nothing is ever buffered unnecessarily, there is much less
|
|
178
|
+
copying data, and less bookkeeping about buffer capacity levels.
|
|
179
|
+
|
|
100
180
|
### Hazards of Buffering (or: Why Minipass Is So Fast)
|
|
101
181
|
|
|
102
182
|
Since data written to a Minipass stream is immediately written all the way
|
|
@@ -181,6 +261,8 @@ moving on to the next entry in an archive parse stream, etc.) then be sure
|
|
|
181
261
|
to call `stream.pause()` on creation, and then `stream.resume()` once you
|
|
182
262
|
are ready to respond to the `end` event.
|
|
183
263
|
|
|
264
|
+
However, this is _usually_ not a problem because:
|
|
265
|
+
|
|
184
266
|
### Emit `end` When Asked
|
|
185
267
|
|
|
186
268
|
One hazard of immediately emitting `'end'` is that you may not yet have had
|
|
@@ -197,6 +279,18 @@ To prevent calling handlers multiple times who would not expect multiple
|
|
|
197
279
|
ends to occur, all listeners are removed from the `'end'` event whenever it
|
|
198
280
|
is emitted.
|
|
199
281
|
|
|
282
|
+
### Emit `error` When Asked
|
|
283
|
+
|
|
284
|
+
The most recent error object passed to the `'error'` event is
|
|
285
|
+
stored on the stream. If a new `'error'` event handler is added,
|
|
286
|
+
and an error was previously emitted, then the event handler will
|
|
287
|
+
be called immediately (or on `process.nextTick` in the case of
|
|
288
|
+
async streams).
|
|
289
|
+
|
|
290
|
+
This makes it much more difficult to end up trying to interact
|
|
291
|
+
with a broken stream, if the error handler is added after an
|
|
292
|
+
error was previously emitted.
|
|
293
|
+
|
|
200
294
|
### Impact of "immediate flow" on Tee-streams
|
|
201
295
|
|
|
202
296
|
A "tee stream" is a stream piping to multiple destinations:
|
|
@@ -221,7 +315,7 @@ src.pipe(dest1) // 'foo' chunk flows to dest1 immediately, and is gone
|
|
|
221
315
|
src.pipe(dest2) // gets nothing!
|
|
222
316
|
```
|
|
223
317
|
|
|
224
|
-
|
|
318
|
+
One solution is to create a dedicated tee-stream junction that pipes to
|
|
225
319
|
both locations, and then pipe to _that_ instead.
|
|
226
320
|
|
|
227
321
|
```js
|
|
@@ -258,6 +352,13 @@ tee.on('data', handler2)
|
|
|
258
352
|
src.pipe(tee)
|
|
259
353
|
```
|
|
260
354
|
|
|
355
|
+
All of the hazards in this section are avoided by setting `{
|
|
356
|
+
async: true }` in the Minipass constructor, or by setting
|
|
357
|
+
`stream.async = true` afterwards. Note that this does add some
|
|
358
|
+
overhead, so should only be done in cases where you are willing
|
|
359
|
+
to lose a bit of performance in order to avoid having to refactor
|
|
360
|
+
program logic.
|
|
361
|
+
|
|
261
362
|
## USAGE
|
|
262
363
|
|
|
263
364
|
It's a stream! Use it like a stream and it'll most likely do what you
|
|
@@ -279,6 +380,10 @@ mp.end('bar')
|
|
|
279
380
|
by default if you write() something other than a string or Buffer at any
|
|
280
381
|
point. Setting `objectMode: true` will prevent setting any encoding
|
|
281
382
|
value.
|
|
383
|
+
* `async` Defaults to `false`. Set to `true` to defer data
|
|
384
|
+
emission until next tick. This reduces performance slightly,
|
|
385
|
+
but makes Minipass streams use timing behavior closer to Node
|
|
386
|
+
core streams. See [Timing](#timing) for more details.
|
|
282
387
|
|
|
283
388
|
### API
|
|
284
389
|
|
|
@@ -300,9 +405,19 @@ streams.
|
|
|
300
405
|
from being emitted for empty streams until the stream is resumed.
|
|
301
406
|
* `resume()` - Resume the stream. If there's data in the buffer, it is all
|
|
302
407
|
discarded. Any buffered events are immediately emitted.
|
|
303
|
-
* `pipe(dest)` - Send all output to the stream provided.
|
|
304
|
-
|
|
305
|
-
|
|
408
|
+
* `pipe(dest)` - Send all output to the stream provided. When
|
|
409
|
+
data is emitted, it is immediately written to any and all pipe
|
|
410
|
+
destinations. (Or written on next tick in `async` mode.)
|
|
411
|
+
* `unpipe(dest)` - Stop piping to the destination stream. This
|
|
412
|
+
is immediate, meaning that any asynchronously queued data will
|
|
413
|
+
_not_ make it to the destination when running in `async` mode.
|
|
414
|
+
* `options.end` - Boolean, end the destination stream when
|
|
415
|
+
the source stream ends. Default `true`.
|
|
416
|
+
* `options.proxyErrors` - Boolean, proxy `error` events from
|
|
417
|
+
the source stream to the destination stream. Note that
|
|
418
|
+
errors are _not_ proxied after the pipeline terminates,
|
|
419
|
+
either due to the source emitting `'end'` or manually
|
|
420
|
+
unpiping with `src.unpipe(dest)`. Default `false`.
|
|
306
421
|
* `on(ev, fn)`, `emit(ev, fn)` - Minipass streams are EventEmitters. Some
|
|
307
422
|
events are given special treatment, however. (See below under "events".)
|
|
308
423
|
* `promise()` - Returns a Promise that resolves when the stream emits
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'events'
|
|
3
|
+
import { Stream } from 'stream'
|
|
4
|
+
|
|
5
|
+
export type Encoding = BufferEncoding | 'buffer' | null
|
|
6
|
+
|
|
7
|
+
interface Writable extends EventEmitter {
|
|
8
|
+
end(): any
|
|
9
|
+
write(chunk: any, ...args: any[]): any
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface Readable extends EventEmitter {
|
|
13
|
+
pause(): any
|
|
14
|
+
resume(): any
|
|
15
|
+
pipe(): any
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface Pipe<R, W> {
|
|
19
|
+
src: Minipass<R, W>
|
|
20
|
+
dest: Writable
|
|
21
|
+
opts: PipeOptions
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type DualIterable<T> = Iterable<T> & AsyncIterable<T>
|
|
25
|
+
|
|
26
|
+
type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string
|
|
27
|
+
|
|
28
|
+
type BufferOrString = Buffer | string
|
|
29
|
+
|
|
30
|
+
export default class Minipass<
|
|
31
|
+
RType extends any = Buffer,
|
|
32
|
+
WType extends any = RType extends BufferOrString ? ContiguousData : RType
|
|
33
|
+
>
|
|
34
|
+
extends Stream
|
|
35
|
+
implements DualIterable<RType>
|
|
36
|
+
{
|
|
37
|
+
static isStream(stream: any): stream is Readable | Writable
|
|
38
|
+
|
|
39
|
+
readonly bufferLength: number
|
|
40
|
+
readonly flowing: boolean
|
|
41
|
+
readonly writable: boolean
|
|
42
|
+
readonly readable: boolean
|
|
43
|
+
readonly paused: boolean
|
|
44
|
+
readonly emittedEnd: boolean
|
|
45
|
+
readonly destroyed: boolean
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Not technically private or readonly, but not safe to mutate.
|
|
49
|
+
*/
|
|
50
|
+
private readonly buffer: RType[]
|
|
51
|
+
private readonly pipes: Pipe<RType, WType>[]
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Technically writable, but mutating it can change the type,
|
|
55
|
+
* so is not safe to do in TypeScript.
|
|
56
|
+
*/
|
|
57
|
+
readonly objectMode: boolean
|
|
58
|
+
async: boolean
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Note: encoding is not actually read-only, and setEncoding(enc)
|
|
62
|
+
* exists. However, this type definition will insist that TypeScript
|
|
63
|
+
* programs declare the type of a Minipass stream up front, and if
|
|
64
|
+
* that type is string, then an encoding MUST be set in the ctor. If
|
|
65
|
+
* the type is Buffer, then the encoding must be missing, or set to
|
|
66
|
+
* 'buffer' or null. If the type is anything else, then objectMode
|
|
67
|
+
* must be set in the constructor options. So there is effectively
|
|
68
|
+
* no allowed way that a TS program can set the encoding after
|
|
69
|
+
* construction, as doing so will destroy any hope of type safety.
|
|
70
|
+
* TypeScript does not provide many options for changing the type of
|
|
71
|
+
* an object at run-time, which is what changing the encoding does.
|
|
72
|
+
*/
|
|
73
|
+
readonly encoding: Encoding
|
|
74
|
+
// setEncoding(encoding: Encoding): void
|
|
75
|
+
|
|
76
|
+
// Options required if not reading buffers
|
|
77
|
+
constructor(
|
|
78
|
+
...args: RType extends Buffer
|
|
79
|
+
? [options?: Options<RType>]
|
|
80
|
+
: [options: Options<RType>]
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
write(chunk: WType, cb?: () => void): boolean
|
|
84
|
+
write(chunk: WType, encoding?: Encoding, cb?: () => void): boolean
|
|
85
|
+
read(size?: number): RType
|
|
86
|
+
end(cb?: () => void): this
|
|
87
|
+
end(chunk: any, cb?: () => void): this
|
|
88
|
+
end(chunk: any, encoding?: Encoding, cb?: () => void): this
|
|
89
|
+
pause(): void
|
|
90
|
+
resume(): void
|
|
91
|
+
promise(): Promise<void>
|
|
92
|
+
collect(): Promise<RType[]>
|
|
93
|
+
|
|
94
|
+
concat(): RType extends BufferOrString ? Promise<RType> : never
|
|
95
|
+
destroy(er?: any): void
|
|
96
|
+
pipe<W extends Writable>(dest: W, opts?: PipeOptions): W
|
|
97
|
+
unpipe<W extends Writable>(dest: W): void
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* alias for on()
|
|
101
|
+
*/
|
|
102
|
+
addEventHandler(event: string, listener: (...args: any[]) => any): this
|
|
103
|
+
|
|
104
|
+
on(event: string, listener: (...args: any[]) => any): this
|
|
105
|
+
on(event: 'data', listener: (chunk: RType) => any): this
|
|
106
|
+
on(event: 'error', listener: (error: any) => any): this
|
|
107
|
+
on(
|
|
108
|
+
event:
|
|
109
|
+
| 'readable'
|
|
110
|
+
| 'drain'
|
|
111
|
+
| 'resume'
|
|
112
|
+
| 'end'
|
|
113
|
+
| 'prefinish'
|
|
114
|
+
| 'finish'
|
|
115
|
+
| 'close',
|
|
116
|
+
listener: () => any
|
|
117
|
+
): this
|
|
118
|
+
|
|
119
|
+
[Symbol.iterator](): Iterator<RType>
|
|
120
|
+
[Symbol.asyncIterator](): AsyncIterator<RType>
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
interface StringOptions {
|
|
124
|
+
encoding: BufferEncoding
|
|
125
|
+
objectMode?: boolean
|
|
126
|
+
async?: boolean
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
interface BufferOptions {
|
|
130
|
+
encoding?: null | 'buffer'
|
|
131
|
+
objectMode?: boolean
|
|
132
|
+
async?: boolean
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
interface ObjectModeOptions {
|
|
136
|
+
objectMode: true
|
|
137
|
+
async?: boolean
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export declare interface PipeOptions {
|
|
141
|
+
end?: boolean
|
|
142
|
+
proxyErrors?: boolean
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export declare type Options<T> = T extends string
|
|
146
|
+
? StringOptions
|
|
147
|
+
: T extends Buffer
|
|
148
|
+
? BufferOptions
|
|
149
|
+
: ObjectModeOptions
|