update electron to v43
This commit is contained in:
parent
68ac0beedf
commit
fb6c8b6ee9
5385 changed files with 513060 additions and 123058 deletions
23
electron/node_modules/rimraf/node_modules/balanced-match/LICENSE.md
generated
vendored
23
electron/node_modules/rimraf/node_modules/balanced-match/LICENSE.md
generated
vendored
|
|
@ -1,23 +0,0 @@
|
|||
(MIT)
|
||||
|
||||
Original code Copyright Julian Gruber <julian@juliangruber.com>
|
||||
|
||||
Port to TypeScript Copyright Isaac Z. Schlueter <i@izs.me>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
57
electron/node_modules/rimraf/node_modules/balanced-match/README.md
generated
vendored
57
electron/node_modules/rimraf/node_modules/balanced-match/README.md
generated
vendored
|
|
@ -1,57 +0,0 @@
|
|||
# balanced-match
|
||||
|
||||
Match balanced string pairs, like `{` and `}` or `<b>` and
|
||||
`</b>`. Supports regular expressions as well!
|
||||
|
||||
## Example
|
||||
|
||||
Get the first matching pair of braces:
|
||||
|
||||
```js
|
||||
import { balanced } from 'balanced-match'
|
||||
|
||||
console.log(balanced('{', '}', 'pre{in{nested}}post'))
|
||||
console.log(balanced('{', '}', 'pre{first}between{second}post'))
|
||||
console.log(
|
||||
balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post'),
|
||||
)
|
||||
```
|
||||
|
||||
The matches are:
|
||||
|
||||
```bash
|
||||
$ node example.js
|
||||
{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }
|
||||
{ start: 3,
|
||||
end: 9,
|
||||
pre: 'pre',
|
||||
body: 'first',
|
||||
post: 'between{second}post' }
|
||||
{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' }
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### const m = balanced(a, b, str)
|
||||
|
||||
For the first non-nested matching pair of `a` and `b` in `str`, return an
|
||||
object with those keys:
|
||||
|
||||
- **start** the index of the first match of `a`
|
||||
- **end** the index of the matching `b`
|
||||
- **pre** the preamble, `a` and `b` not included
|
||||
- **body** the match, `a` and `b` not included
|
||||
- **post** the postscript, `a` and `b` not included
|
||||
|
||||
If there's no match, `undefined` will be returned.
|
||||
|
||||
If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`.
|
||||
|
||||
### const r = balanced.range(a, b, str)
|
||||
|
||||
For the first non-nested matching pair of `a` and `b` in `str`, return an
|
||||
array with indexes: `[ <a index>, <b index> ]`.
|
||||
|
||||
If there's no match, `undefined` will be returned.
|
||||
|
||||
If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`.
|
||||
9
electron/node_modules/rimraf/node_modules/balanced-match/dist/commonjs/index.d.ts
generated
vendored
9
electron/node_modules/rimraf/node_modules/balanced-match/dist/commonjs/index.d.ts
generated
vendored
|
|
@ -1,9 +0,0 @@
|
|||
export declare const balanced: (a: string | RegExp, b: string | RegExp, str: string) => false | {
|
||||
start: number;
|
||||
end: number;
|
||||
pre: string;
|
||||
body: string;
|
||||
post: string;
|
||||
} | undefined;
|
||||
export declare const range: (a: string, b: string, str: string) => undefined | [number, number];
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,GAAG,MAAM,EAClB,GAAG,MAAM,GAAG,MAAM,EAClB,KAAK,MAAM;;;;;;aAgBZ,CAAA;AAOD,eAAO,MAAM,KAAK,GAChB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,KAAK,MAAM,KACV,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CA2C7B,CAAA"}
|
||||
59
electron/node_modules/rimraf/node_modules/balanced-match/dist/commonjs/index.js
generated
vendored
59
electron/node_modules/rimraf/node_modules/balanced-match/dist/commonjs/index.js
generated
vendored
|
|
@ -1,59 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.range = exports.balanced = void 0;
|
||||
const balanced = (a, b, str) => {
|
||||
const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
|
||||
const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
|
||||
const r = ma !== null && mb != null && (0, exports.range)(ma, mb, str);
|
||||
return (r && {
|
||||
start: r[0],
|
||||
end: r[1],
|
||||
pre: str.slice(0, r[0]),
|
||||
body: str.slice(r[0] + ma.length, r[1]),
|
||||
post: str.slice(r[1] + mb.length),
|
||||
});
|
||||
};
|
||||
exports.balanced = balanced;
|
||||
const maybeMatch = (reg, str) => {
|
||||
const m = str.match(reg);
|
||||
return m ? m[0] : null;
|
||||
};
|
||||
const range = (a, b, str) => {
|
||||
let begs, beg, left, right = undefined, result;
|
||||
let ai = str.indexOf(a);
|
||||
let bi = str.indexOf(b, ai + 1);
|
||||
let i = ai;
|
||||
if (ai >= 0 && bi > 0) {
|
||||
if (a === b) {
|
||||
return [ai, bi];
|
||||
}
|
||||
begs = [];
|
||||
left = str.length;
|
||||
while (i >= 0 && !result) {
|
||||
if (i === ai) {
|
||||
begs.push(i);
|
||||
ai = str.indexOf(a, i + 1);
|
||||
}
|
||||
else if (begs.length === 1) {
|
||||
const r = begs.pop();
|
||||
if (r !== undefined)
|
||||
result = [r, bi];
|
||||
}
|
||||
else {
|
||||
beg = begs.pop();
|
||||
if (beg !== undefined && beg < left) {
|
||||
left = beg;
|
||||
right = bi;
|
||||
}
|
||||
bi = str.indexOf(b, i + 1);
|
||||
}
|
||||
i = ai < bi && ai >= 0 ? ai : bi;
|
||||
}
|
||||
if (begs.length && right !== undefined) {
|
||||
result = [left, right];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
exports.range = range;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
electron/node_modules/rimraf/node_modules/balanced-match/dist/commonjs/index.js.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/balanced-match/dist/commonjs/index.js.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"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","sourcesContent":["export const balanced = (\n a: string | RegExp,\n b: string | RegExp,\n str: string,\n) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b\n\n const r = ma !== null && mb != null && range(ma, mb, str)\n\n return (\n r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n }\n )\n}\n\nconst maybeMatch = (reg: RegExp, str: string) => {\n const m = str.match(reg)\n return m ? m[0] : null\n}\n\nexport const range = (\n a: string,\n b: string,\n str: string,\n): undefined | [number, number] => {\n let begs: number[],\n beg: number | undefined,\n left: number,\n right: number | undefined = undefined,\n result: undefined | [number, number]\n let ai = str.indexOf(a)\n let bi = str.indexOf(b, ai + 1)\n let i = ai\n\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi]\n }\n begs = []\n left = str.length\n\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i)\n ai = str.indexOf(a, i + 1)\n } else if (begs.length === 1) {\n const r = begs.pop()\n if (r !== undefined) result = [r, bi]\n } else {\n beg = begs.pop()\n if (beg !== undefined && beg < left) {\n left = beg\n right = bi\n }\n\n bi = str.indexOf(b, i + 1)\n }\n\n i = ai < bi && ai >= 0 ? ai : bi\n }\n\n if (begs.length && right !== undefined) {\n result = [left, right]\n }\n }\n\n return result\n}\n"]}
|
||||
3
electron/node_modules/rimraf/node_modules/balanced-match/dist/commonjs/package.json
generated
vendored
3
electron/node_modules/rimraf/node_modules/balanced-match/dist/commonjs/package.json
generated
vendored
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"type": "commonjs"
|
||||
}
|
||||
9
electron/node_modules/rimraf/node_modules/balanced-match/dist/esm/index.d.ts
generated
vendored
9
electron/node_modules/rimraf/node_modules/balanced-match/dist/esm/index.d.ts
generated
vendored
|
|
@ -1,9 +0,0 @@
|
|||
export declare const balanced: (a: string | RegExp, b: string | RegExp, str: string) => false | {
|
||||
start: number;
|
||||
end: number;
|
||||
pre: string;
|
||||
body: string;
|
||||
post: string;
|
||||
} | undefined;
|
||||
export declare const range: (a: string, b: string, str: string) => undefined | [number, number];
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
electron/node_modules/rimraf/node_modules/balanced-match/dist/esm/index.d.ts.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/balanced-match/dist/esm/index.d.ts.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,GAAG,MAAM,EAClB,GAAG,MAAM,GAAG,MAAM,EAClB,KAAK,MAAM;;;;;;aAgBZ,CAAA;AAOD,eAAO,MAAM,KAAK,GAChB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,KAAK,MAAM,KACV,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CA2C7B,CAAA"}
|
||||
54
electron/node_modules/rimraf/node_modules/balanced-match/dist/esm/index.js
generated
vendored
54
electron/node_modules/rimraf/node_modules/balanced-match/dist/esm/index.js
generated
vendored
|
|
@ -1,54 +0,0 @@
|
|||
export const balanced = (a, b, str) => {
|
||||
const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
|
||||
const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
|
||||
const r = ma !== null && mb != null && range(ma, mb, str);
|
||||
return (r && {
|
||||
start: r[0],
|
||||
end: r[1],
|
||||
pre: str.slice(0, r[0]),
|
||||
body: str.slice(r[0] + ma.length, r[1]),
|
||||
post: str.slice(r[1] + mb.length),
|
||||
});
|
||||
};
|
||||
const maybeMatch = (reg, str) => {
|
||||
const m = str.match(reg);
|
||||
return m ? m[0] : null;
|
||||
};
|
||||
export const range = (a, b, str) => {
|
||||
let begs, beg, left, right = undefined, result;
|
||||
let ai = str.indexOf(a);
|
||||
let bi = str.indexOf(b, ai + 1);
|
||||
let i = ai;
|
||||
if (ai >= 0 && bi > 0) {
|
||||
if (a === b) {
|
||||
return [ai, bi];
|
||||
}
|
||||
begs = [];
|
||||
left = str.length;
|
||||
while (i >= 0 && !result) {
|
||||
if (i === ai) {
|
||||
begs.push(i);
|
||||
ai = str.indexOf(a, i + 1);
|
||||
}
|
||||
else if (begs.length === 1) {
|
||||
const r = begs.pop();
|
||||
if (r !== undefined)
|
||||
result = [r, bi];
|
||||
}
|
||||
else {
|
||||
beg = begs.pop();
|
||||
if (beg !== undefined && beg < left) {
|
||||
left = beg;
|
||||
right = bi;
|
||||
}
|
||||
bi = str.indexOf(b, i + 1);
|
||||
}
|
||||
i = ai < bi && ai >= 0 ? ai : bi;
|
||||
}
|
||||
if (begs.length && right !== undefined) {
|
||||
result = [left, right];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
electron/node_modules/rimraf/node_modules/balanced-match/dist/esm/index.js.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/balanced-match/dist/esm/index.js.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"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","sourcesContent":["export const balanced = (\n a: string | RegExp,\n b: string | RegExp,\n str: string,\n) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b\n\n const r = ma !== null && mb != null && range(ma, mb, str)\n\n return (\n r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n }\n )\n}\n\nconst maybeMatch = (reg: RegExp, str: string) => {\n const m = str.match(reg)\n return m ? m[0] : null\n}\n\nexport const range = (\n a: string,\n b: string,\n str: string,\n): undefined | [number, number] => {\n let begs: number[],\n beg: number | undefined,\n left: number,\n right: number | undefined = undefined,\n result: undefined | [number, number]\n let ai = str.indexOf(a)\n let bi = str.indexOf(b, ai + 1)\n let i = ai\n\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi]\n }\n begs = []\n left = str.length\n\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i)\n ai = str.indexOf(a, i + 1)\n } else if (begs.length === 1) {\n const r = begs.pop()\n if (r !== undefined) result = [r, bi]\n } else {\n beg = begs.pop()\n if (beg !== undefined && beg < left) {\n left = beg\n right = bi\n }\n\n bi = str.indexOf(b, i + 1)\n }\n\n i = ai < bi && ai >= 0 ? ai : bi\n }\n\n if (begs.length && right !== undefined) {\n result = [left, right]\n }\n }\n\n return result\n}\n"]}
|
||||
3
electron/node_modules/rimraf/node_modules/balanced-match/dist/esm/package.json
generated
vendored
3
electron/node_modules/rimraf/node_modules/balanced-match/dist/esm/package.json
generated
vendored
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"type": "module"
|
||||
}
|
||||
68
electron/node_modules/rimraf/node_modules/balanced-match/package.json
generated
vendored
68
electron/node_modules/rimraf/node_modules/balanced-match/package.json
generated
vendored
|
|
@ -1,68 +0,0 @@
|
|||
{
|
||||
"name": "balanced-match",
|
||||
"description": "Match balanced character pairs, like \"{\" and \"}\"",
|
||||
"version": "4.0.4",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/juliangruber/balanced-match.git"
|
||||
},
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./dist/esm/index.d.ts",
|
||||
"default": "./dist/esm/index.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/commonjs/index.d.ts",
|
||||
"default": "./dist/commonjs/index.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"preversion": "npm test",
|
||||
"postversion": "npm publish",
|
||||
"prepublishOnly": "git push origin --follow-tags",
|
||||
"prepare": "tshy",
|
||||
"pretest": "npm run prepare",
|
||||
"presnap": "npm run prepare",
|
||||
"test": "tap",
|
||||
"snap": "tap",
|
||||
"format": "prettier --write .",
|
||||
"benchmark": "node benchmark/index.js",
|
||||
"typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/brace-expansion": "^1.1.2",
|
||||
"@types/node": "^25.2.1",
|
||||
"mkdirp": "^3.0.1",
|
||||
"prettier": "^3.3.2",
|
||||
"tap": "^21.6.2",
|
||||
"tshy": "^3.0.2",
|
||||
"typedoc": "^0.28.5"
|
||||
},
|
||||
"keywords": [
|
||||
"match",
|
||||
"regexp",
|
||||
"test",
|
||||
"balanced",
|
||||
"parse"
|
||||
],
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "18 || 20 || >=22"
|
||||
},
|
||||
"tshy": {
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
".": "./src/index.ts"
|
||||
}
|
||||
},
|
||||
"main": "./dist/commonjs/index.js",
|
||||
"types": "./dist/commonjs/index.d.ts",
|
||||
"module": "./dist/esm/index.js"
|
||||
}
|
||||
23
electron/node_modules/rimraf/node_modules/brace-expansion/LICENSE
generated
vendored
23
electron/node_modules/rimraf/node_modules/brace-expansion/LICENSE
generated
vendored
|
|
@ -1,23 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright Julian Gruber <julian@juliangruber.com>
|
||||
|
||||
TypeScript port Copyright Isaac Z. Schlueter <i@izs.me>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
94
electron/node_modules/rimraf/node_modules/brace-expansion/README.md
generated
vendored
94
electron/node_modules/rimraf/node_modules/brace-expansion/README.md
generated
vendored
|
|
@ -1,94 +0,0 @@
|
|||
# brace-expansion
|
||||
|
||||
[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html),
|
||||
as known from sh/bash, in JavaScript.
|
||||
|
||||
[](https://github.com/juliangruber/brace-expansion/actions/workflows/ci.yml)
|
||||
[](https://www.npmjs.org/package/brace-expansion)
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
import { expand } from 'brace-expansion'
|
||||
|
||||
expand('file-{a,b,c}.jpg')
|
||||
// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
|
||||
|
||||
expand('-v{,,}')
|
||||
// => ['-v', '-v', '-v']
|
||||
|
||||
expand('file{0..2}.jpg')
|
||||
// => ['file0.jpg', 'file1.jpg', 'file2.jpg']
|
||||
|
||||
expand('file-{a..c}.jpg')
|
||||
// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
|
||||
|
||||
expand('file{2..0}.jpg')
|
||||
// => ['file2.jpg', 'file1.jpg', 'file0.jpg']
|
||||
|
||||
expand('file{0..4..2}.jpg')
|
||||
// => ['file0.jpg', 'file2.jpg', 'file4.jpg']
|
||||
|
||||
expand('file-{a..e..2}.jpg')
|
||||
// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg']
|
||||
|
||||
expand('file{00..10..5}.jpg')
|
||||
// => ['file00.jpg', 'file05.jpg', 'file10.jpg']
|
||||
|
||||
expand('{{A..C},{a..c}}')
|
||||
// => ['A', 'B', 'C', 'a', 'b', 'c']
|
||||
|
||||
expand('ppp{,config,oe{,conf}}')
|
||||
// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
```js
|
||||
import { expand } from 'brace-expansion'
|
||||
```
|
||||
|
||||
### const expanded = expand(str, [options])
|
||||
|
||||
Return an array of all possible and valid expansions of `str`. If
|
||||
none are found, `[str]` is returned.
|
||||
|
||||
The `options` object can provide a `max` value to cap the number
|
||||
of expansions allowed. This is limited to `100_000` by default,
|
||||
to prevent DoS attacks.
|
||||
|
||||
```js
|
||||
const expansions = expand('{1..100}'.repeat(5), {
|
||||
max: 100,
|
||||
})
|
||||
// expansions.length will be 100, not 100^5
|
||||
```
|
||||
|
||||
Valid expansions are:
|
||||
|
||||
```js
|
||||
;/^(.*,)+(.+)?$/
|
||||
// {a,b,...}
|
||||
```
|
||||
|
||||
A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.
|
||||
|
||||
```js
|
||||
;/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
|
||||
// {x..y[..incr]}
|
||||
```
|
||||
|
||||
A numeric sequence from `x` to `y` inclusive, with optional increment.
|
||||
If `x` or `y` start with a leading `0`, all the numbers will be padded
|
||||
to have equal length. Negative numbers and backwards iteration work too.
|
||||
|
||||
```js
|
||||
;/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
|
||||
// {x..y[..incr]}
|
||||
```
|
||||
|
||||
An alphabetic sequence from `x` to `y` inclusive, with optional increment.
|
||||
`x` and `y` must be exactly one character, and if given, `incr` must be a
|
||||
number.
|
||||
|
||||
For compatibility reasons, the string `${` is not eligible for brace expansion.
|
||||
6
electron/node_modules/rimraf/node_modules/brace-expansion/dist/commonjs/index.d.ts
generated
vendored
6
electron/node_modules/rimraf/node_modules/brace-expansion/dist/commonjs/index.d.ts
generated
vendored
|
|
@ -1,6 +0,0 @@
|
|||
export declare const EXPANSION_MAX = 100000;
|
||||
export type BraceExpansionOptions = {
|
||||
max?: number;
|
||||
};
|
||||
export declare function expand(str: string, options?: BraceExpansionOptions): string[];
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,aAAa,SAAU,CAAA;AAwDpC,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,YAkBtE"}
|
||||
201
electron/node_modules/rimraf/node_modules/brace-expansion/dist/commonjs/index.js
generated
vendored
201
electron/node_modules/rimraf/node_modules/brace-expansion/dist/commonjs/index.js
generated
vendored
|
|
@ -1,201 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.EXPANSION_MAX = void 0;
|
||||
exports.expand = expand;
|
||||
const balanced_match_1 = require("balanced-match");
|
||||
const escSlash = '\0SLASH' + Math.random() + '\0';
|
||||
const escOpen = '\0OPEN' + Math.random() + '\0';
|
||||
const escClose = '\0CLOSE' + Math.random() + '\0';
|
||||
const escComma = '\0COMMA' + Math.random() + '\0';
|
||||
const escPeriod = '\0PERIOD' + Math.random() + '\0';
|
||||
const escSlashPattern = new RegExp(escSlash, 'g');
|
||||
const escOpenPattern = new RegExp(escOpen, 'g');
|
||||
const escClosePattern = new RegExp(escClose, 'g');
|
||||
const escCommaPattern = new RegExp(escComma, 'g');
|
||||
const escPeriodPattern = new RegExp(escPeriod, 'g');
|
||||
const slashPattern = /\\\\/g;
|
||||
const openPattern = /\\{/g;
|
||||
const closePattern = /\\}/g;
|
||||
const commaPattern = /\\,/g;
|
||||
const periodPattern = /\\\./g;
|
||||
exports.EXPANSION_MAX = 100_000;
|
||||
function numeric(str) {
|
||||
return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
|
||||
}
|
||||
function escapeBraces(str) {
|
||||
return str
|
||||
.replace(slashPattern, escSlash)
|
||||
.replace(openPattern, escOpen)
|
||||
.replace(closePattern, escClose)
|
||||
.replace(commaPattern, escComma)
|
||||
.replace(periodPattern, escPeriod);
|
||||
}
|
||||
function unescapeBraces(str) {
|
||||
return str
|
||||
.replace(escSlashPattern, '\\')
|
||||
.replace(escOpenPattern, '{')
|
||||
.replace(escClosePattern, '}')
|
||||
.replace(escCommaPattern, ',')
|
||||
.replace(escPeriodPattern, '.');
|
||||
}
|
||||
/**
|
||||
* Basically just str.split(","), but handling cases
|
||||
* where we have nested braced sections, which should be
|
||||
* treated as individual members, like {a,{b,c},d}
|
||||
*/
|
||||
function parseCommaParts(str) {
|
||||
if (!str) {
|
||||
return [''];
|
||||
}
|
||||
const parts = [];
|
||||
const m = (0, balanced_match_1.balanced)('{', '}', str);
|
||||
if (!m) {
|
||||
return str.split(',');
|
||||
}
|
||||
const { pre, body, post } = m;
|
||||
const p = pre.split(',');
|
||||
p[p.length - 1] += '{' + body + '}';
|
||||
const postParts = parseCommaParts(post);
|
||||
if (post.length) {
|
||||
;
|
||||
p[p.length - 1] += postParts.shift();
|
||||
p.push.apply(p, postParts);
|
||||
}
|
||||
parts.push.apply(parts, p);
|
||||
return parts;
|
||||
}
|
||||
function expand(str, options = {}) {
|
||||
if (!str) {
|
||||
return [];
|
||||
}
|
||||
const { max = exports.EXPANSION_MAX } = options;
|
||||
// I don't know why Bash 4.3 does this, but it does.
|
||||
// Anything starting with {} will have the first two bytes preserved
|
||||
// but *only* at the top level, so {},a}b will not expand to anything,
|
||||
// but a{},b}c will be expanded to [a}c,abc].
|
||||
// One could argue that this is a bug in Bash, but since the goal of
|
||||
// this module is to match Bash's rules, we escape a leading {}
|
||||
if (str.slice(0, 2) === '{}') {
|
||||
str = '\\{\\}' + str.slice(2);
|
||||
}
|
||||
return expand_(escapeBraces(str), max, true).map(unescapeBraces);
|
||||
}
|
||||
function embrace(str) {
|
||||
return '{' + str + '}';
|
||||
}
|
||||
function isPadded(el) {
|
||||
return /^-?0\d/.test(el);
|
||||
}
|
||||
function lte(i, y) {
|
||||
return i <= y;
|
||||
}
|
||||
function gte(i, y) {
|
||||
return i >= y;
|
||||
}
|
||||
function expand_(str, max, isTop) {
|
||||
/** @type {string[]} */
|
||||
const expansions = [];
|
||||
const m = (0, balanced_match_1.balanced)('{', '}', str);
|
||||
if (!m)
|
||||
return [str];
|
||||
// no need to expand pre, since it is guaranteed to be free of brace-sets
|
||||
const pre = m.pre;
|
||||
const post = m.post.length ? expand_(m.post, max, false) : [''];
|
||||
if (/\$$/.test(m.pre)) {
|
||||
for (let k = 0; k < post.length && k < max; k++) {
|
||||
const expansion = pre + '{' + m.body + '}' + post[k];
|
||||
expansions.push(expansion);
|
||||
}
|
||||
}
|
||||
else {
|
||||
const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
||||
const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
||||
const isSequence = isNumericSequence || isAlphaSequence;
|
||||
const isOptions = m.body.indexOf(',') >= 0;
|
||||
if (!isSequence && !isOptions) {
|
||||
// {a},b}
|
||||
if (m.post.match(/,(?!,).*\}/)) {
|
||||
str = m.pre + '{' + m.body + escClose + m.post;
|
||||
return expand_(str, max, true);
|
||||
}
|
||||
return [str];
|
||||
}
|
||||
let n;
|
||||
if (isSequence) {
|
||||
n = m.body.split(/\.\./);
|
||||
}
|
||||
else {
|
||||
n = parseCommaParts(m.body);
|
||||
if (n.length === 1 && n[0] !== undefined) {
|
||||
// x{{a,b}}y ==> x{a}y x{b}y
|
||||
n = expand_(n[0], max, false).map(embrace);
|
||||
//XXX is this necessary? Can't seem to hit it in tests.
|
||||
/* c8 ignore start */
|
||||
if (n.length === 1) {
|
||||
return post.map(p => m.pre + n[0] + p);
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
}
|
||||
}
|
||||
// at this point, n is the parts, and we know it's not a comma set
|
||||
// with a single entry.
|
||||
let N;
|
||||
if (isSequence && n[0] !== undefined && n[1] !== undefined) {
|
||||
const x = numeric(n[0]);
|
||||
const y = numeric(n[1]);
|
||||
const width = Math.max(n[0].length, n[1].length);
|
||||
let incr = n.length === 3 && n[2] !== undefined ?
|
||||
Math.max(Math.abs(numeric(n[2])), 1)
|
||||
: 1;
|
||||
let test = lte;
|
||||
const reverse = y < x;
|
||||
if (reverse) {
|
||||
incr *= -1;
|
||||
test = gte;
|
||||
}
|
||||
const pad = n.some(isPadded);
|
||||
N = [];
|
||||
for (let i = x; test(i, y); i += incr) {
|
||||
let c;
|
||||
if (isAlphaSequence) {
|
||||
c = String.fromCharCode(i);
|
||||
if (c === '\\') {
|
||||
c = '';
|
||||
}
|
||||
}
|
||||
else {
|
||||
c = String(i);
|
||||
if (pad) {
|
||||
const need = width - c.length;
|
||||
if (need > 0) {
|
||||
const z = new Array(need + 1).join('0');
|
||||
if (i < 0) {
|
||||
c = '-' + z + c.slice(1);
|
||||
}
|
||||
else {
|
||||
c = z + c;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
N.push(c);
|
||||
}
|
||||
}
|
||||
else {
|
||||
N = [];
|
||||
for (let j = 0; j < n.length; j++) {
|
||||
N.push.apply(N, expand_(n[j], max, false));
|
||||
}
|
||||
}
|
||||
for (let j = 0; j < N.length; j++) {
|
||||
for (let k = 0; k < post.length && expansions.length < max; k++) {
|
||||
const expansion = pre + N[j] + post[k];
|
||||
if (!isTop || isSequence || expansion) {
|
||||
expansions.push(expansion);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return expansions;
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
electron/node_modules/rimraf/node_modules/brace-expansion/dist/commonjs/index.js.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/brace-expansion/dist/commonjs/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
3
electron/node_modules/rimraf/node_modules/brace-expansion/dist/commonjs/package.json
generated
vendored
3
electron/node_modules/rimraf/node_modules/brace-expansion/dist/commonjs/package.json
generated
vendored
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"type": "commonjs"
|
||||
}
|
||||
6
electron/node_modules/rimraf/node_modules/brace-expansion/dist/esm/index.d.ts
generated
vendored
6
electron/node_modules/rimraf/node_modules/brace-expansion/dist/esm/index.d.ts
generated
vendored
|
|
@ -1,6 +0,0 @@
|
|||
export declare const EXPANSION_MAX = 100000;
|
||||
export type BraceExpansionOptions = {
|
||||
max?: number;
|
||||
};
|
||||
export declare function expand(str: string, options?: BraceExpansionOptions): string[];
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
electron/node_modules/rimraf/node_modules/brace-expansion/dist/esm/index.d.ts.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/brace-expansion/dist/esm/index.d.ts.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,aAAa,SAAU,CAAA;AAwDpC,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,YAkBtE"}
|
||||
197
electron/node_modules/rimraf/node_modules/brace-expansion/dist/esm/index.js
generated
vendored
197
electron/node_modules/rimraf/node_modules/brace-expansion/dist/esm/index.js
generated
vendored
|
|
@ -1,197 +0,0 @@
|
|||
import { balanced } from 'balanced-match';
|
||||
const escSlash = '\0SLASH' + Math.random() + '\0';
|
||||
const escOpen = '\0OPEN' + Math.random() + '\0';
|
||||
const escClose = '\0CLOSE' + Math.random() + '\0';
|
||||
const escComma = '\0COMMA' + Math.random() + '\0';
|
||||
const escPeriod = '\0PERIOD' + Math.random() + '\0';
|
||||
const escSlashPattern = new RegExp(escSlash, 'g');
|
||||
const escOpenPattern = new RegExp(escOpen, 'g');
|
||||
const escClosePattern = new RegExp(escClose, 'g');
|
||||
const escCommaPattern = new RegExp(escComma, 'g');
|
||||
const escPeriodPattern = new RegExp(escPeriod, 'g');
|
||||
const slashPattern = /\\\\/g;
|
||||
const openPattern = /\\{/g;
|
||||
const closePattern = /\\}/g;
|
||||
const commaPattern = /\\,/g;
|
||||
const periodPattern = /\\\./g;
|
||||
export const EXPANSION_MAX = 100_000;
|
||||
function numeric(str) {
|
||||
return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
|
||||
}
|
||||
function escapeBraces(str) {
|
||||
return str
|
||||
.replace(slashPattern, escSlash)
|
||||
.replace(openPattern, escOpen)
|
||||
.replace(closePattern, escClose)
|
||||
.replace(commaPattern, escComma)
|
||||
.replace(periodPattern, escPeriod);
|
||||
}
|
||||
function unescapeBraces(str) {
|
||||
return str
|
||||
.replace(escSlashPattern, '\\')
|
||||
.replace(escOpenPattern, '{')
|
||||
.replace(escClosePattern, '}')
|
||||
.replace(escCommaPattern, ',')
|
||||
.replace(escPeriodPattern, '.');
|
||||
}
|
||||
/**
|
||||
* Basically just str.split(","), but handling cases
|
||||
* where we have nested braced sections, which should be
|
||||
* treated as individual members, like {a,{b,c},d}
|
||||
*/
|
||||
function parseCommaParts(str) {
|
||||
if (!str) {
|
||||
return [''];
|
||||
}
|
||||
const parts = [];
|
||||
const m = balanced('{', '}', str);
|
||||
if (!m) {
|
||||
return str.split(',');
|
||||
}
|
||||
const { pre, body, post } = m;
|
||||
const p = pre.split(',');
|
||||
p[p.length - 1] += '{' + body + '}';
|
||||
const postParts = parseCommaParts(post);
|
||||
if (post.length) {
|
||||
;
|
||||
p[p.length - 1] += postParts.shift();
|
||||
p.push.apply(p, postParts);
|
||||
}
|
||||
parts.push.apply(parts, p);
|
||||
return parts;
|
||||
}
|
||||
export function expand(str, options = {}) {
|
||||
if (!str) {
|
||||
return [];
|
||||
}
|
||||
const { max = EXPANSION_MAX } = options;
|
||||
// I don't know why Bash 4.3 does this, but it does.
|
||||
// Anything starting with {} will have the first two bytes preserved
|
||||
// but *only* at the top level, so {},a}b will not expand to anything,
|
||||
// but a{},b}c will be expanded to [a}c,abc].
|
||||
// One could argue that this is a bug in Bash, but since the goal of
|
||||
// this module is to match Bash's rules, we escape a leading {}
|
||||
if (str.slice(0, 2) === '{}') {
|
||||
str = '\\{\\}' + str.slice(2);
|
||||
}
|
||||
return expand_(escapeBraces(str), max, true).map(unescapeBraces);
|
||||
}
|
||||
function embrace(str) {
|
||||
return '{' + str + '}';
|
||||
}
|
||||
function isPadded(el) {
|
||||
return /^-?0\d/.test(el);
|
||||
}
|
||||
function lte(i, y) {
|
||||
return i <= y;
|
||||
}
|
||||
function gte(i, y) {
|
||||
return i >= y;
|
||||
}
|
||||
function expand_(str, max, isTop) {
|
||||
/** @type {string[]} */
|
||||
const expansions = [];
|
||||
const m = balanced('{', '}', str);
|
||||
if (!m)
|
||||
return [str];
|
||||
// no need to expand pre, since it is guaranteed to be free of brace-sets
|
||||
const pre = m.pre;
|
||||
const post = m.post.length ? expand_(m.post, max, false) : [''];
|
||||
if (/\$$/.test(m.pre)) {
|
||||
for (let k = 0; k < post.length && k < max; k++) {
|
||||
const expansion = pre + '{' + m.body + '}' + post[k];
|
||||
expansions.push(expansion);
|
||||
}
|
||||
}
|
||||
else {
|
||||
const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
||||
const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
||||
const isSequence = isNumericSequence || isAlphaSequence;
|
||||
const isOptions = m.body.indexOf(',') >= 0;
|
||||
if (!isSequence && !isOptions) {
|
||||
// {a},b}
|
||||
if (m.post.match(/,(?!,).*\}/)) {
|
||||
str = m.pre + '{' + m.body + escClose + m.post;
|
||||
return expand_(str, max, true);
|
||||
}
|
||||
return [str];
|
||||
}
|
||||
let n;
|
||||
if (isSequence) {
|
||||
n = m.body.split(/\.\./);
|
||||
}
|
||||
else {
|
||||
n = parseCommaParts(m.body);
|
||||
if (n.length === 1 && n[0] !== undefined) {
|
||||
// x{{a,b}}y ==> x{a}y x{b}y
|
||||
n = expand_(n[0], max, false).map(embrace);
|
||||
//XXX is this necessary? Can't seem to hit it in tests.
|
||||
/* c8 ignore start */
|
||||
if (n.length === 1) {
|
||||
return post.map(p => m.pre + n[0] + p);
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
}
|
||||
}
|
||||
// at this point, n is the parts, and we know it's not a comma set
|
||||
// with a single entry.
|
||||
let N;
|
||||
if (isSequence && n[0] !== undefined && n[1] !== undefined) {
|
||||
const x = numeric(n[0]);
|
||||
const y = numeric(n[1]);
|
||||
const width = Math.max(n[0].length, n[1].length);
|
||||
let incr = n.length === 3 && n[2] !== undefined ?
|
||||
Math.max(Math.abs(numeric(n[2])), 1)
|
||||
: 1;
|
||||
let test = lte;
|
||||
const reverse = y < x;
|
||||
if (reverse) {
|
||||
incr *= -1;
|
||||
test = gte;
|
||||
}
|
||||
const pad = n.some(isPadded);
|
||||
N = [];
|
||||
for (let i = x; test(i, y); i += incr) {
|
||||
let c;
|
||||
if (isAlphaSequence) {
|
||||
c = String.fromCharCode(i);
|
||||
if (c === '\\') {
|
||||
c = '';
|
||||
}
|
||||
}
|
||||
else {
|
||||
c = String(i);
|
||||
if (pad) {
|
||||
const need = width - c.length;
|
||||
if (need > 0) {
|
||||
const z = new Array(need + 1).join('0');
|
||||
if (i < 0) {
|
||||
c = '-' + z + c.slice(1);
|
||||
}
|
||||
else {
|
||||
c = z + c;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
N.push(c);
|
||||
}
|
||||
}
|
||||
else {
|
||||
N = [];
|
||||
for (let j = 0; j < n.length; j++) {
|
||||
N.push.apply(N, expand_(n[j], max, false));
|
||||
}
|
||||
}
|
||||
for (let j = 0; j < N.length; j++) {
|
||||
for (let k = 0; k < post.length && expansions.length < max; k++) {
|
||||
const expansion = pre + N[j] + post[k];
|
||||
if (!isTop || isSequence || expansion) {
|
||||
expansions.push(expansion);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return expansions;
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
electron/node_modules/rimraf/node_modules/brace-expansion/dist/esm/index.js.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/brace-expansion/dist/esm/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
3
electron/node_modules/rimraf/node_modules/brace-expansion/dist/esm/package.json
generated
vendored
3
electron/node_modules/rimraf/node_modules/brace-expansion/dist/esm/package.json
generated
vendored
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"type": "module"
|
||||
}
|
||||
64
electron/node_modules/rimraf/node_modules/brace-expansion/package.json
generated
vendored
64
electron/node_modules/rimraf/node_modules/brace-expansion/package.json
generated
vendored
|
|
@ -1,64 +0,0 @@
|
|||
{
|
||||
"name": "brace-expansion",
|
||||
"description": "Brace expansion as known from sh/bash",
|
||||
"version": "5.0.5",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./dist/esm/index.d.ts",
|
||||
"default": "./dist/esm/index.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/commonjs/index.d.ts",
|
||||
"default": "./dist/commonjs/index.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"preversion": "npm test",
|
||||
"postversion": "npm publish",
|
||||
"prepublishOnly": "git push origin --follow-tags",
|
||||
"prepare": "tshy",
|
||||
"pretest": "npm run prepare",
|
||||
"presnap": "npm run prepare",
|
||||
"test": "tap",
|
||||
"snap": "tap",
|
||||
"format": "prettier --write .",
|
||||
"benchmark": "node benchmark/index.js",
|
||||
"typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/brace-expansion": "^1.1.2",
|
||||
"@types/node": "^25.2.1",
|
||||
"mkdirp": "^3.0.1",
|
||||
"prettier": "^3.3.2",
|
||||
"tap": "^21.6.2",
|
||||
"tshy": "^3.0.2",
|
||||
"typedoc": "^0.28.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"balanced-match": "^4.0.2"
|
||||
},
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "18 || 20 || >=22"
|
||||
},
|
||||
"tshy": {
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
".": "./src/index.ts"
|
||||
}
|
||||
},
|
||||
"main": "./dist/commonjs/index.js",
|
||||
"types": "./dist/commonjs/index.d.ts",
|
||||
"module": "./dist/esm/index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/juliangruber/brace-expansion.git"
|
||||
}
|
||||
}
|
||||
55
electron/node_modules/rimraf/node_modules/minimatch/LICENSE.md
generated
vendored
55
electron/node_modules/rimraf/node_modules/minimatch/LICENSE.md
generated
vendored
|
|
@ -1,55 +0,0 @@
|
|||
# Blue Oak Model License
|
||||
|
||||
Version 1.0.0
|
||||
|
||||
## Purpose
|
||||
|
||||
This license gives everyone as much permission to work with
|
||||
this software as possible, while protecting contributors
|
||||
from liability.
|
||||
|
||||
## Acceptance
|
||||
|
||||
In order to receive this license, you must agree to its
|
||||
rules. The rules of this license are both obligations
|
||||
under that agreement and conditions to your license.
|
||||
You must not do anything with this software that triggers
|
||||
a rule that you cannot or will not follow.
|
||||
|
||||
## Copyright
|
||||
|
||||
Each contributor licenses you to do everything with this
|
||||
software that would otherwise infringe that contributor's
|
||||
copyright in it.
|
||||
|
||||
## Notices
|
||||
|
||||
You must ensure that everyone who gets a copy of
|
||||
any part of this software from you, with or without
|
||||
changes, also gets the text of this license or a link to
|
||||
<https://blueoakcouncil.org/license/1.0.0>.
|
||||
|
||||
## Excuse
|
||||
|
||||
If anyone notifies you in writing that you have not
|
||||
complied with [Notices](#notices), you can keep your
|
||||
license by taking all practical steps to comply within 30
|
||||
days after the notice. If you do not do so, your license
|
||||
ends immediately.
|
||||
|
||||
## Patent
|
||||
|
||||
Each contributor licenses you to do everything with this
|
||||
software that would otherwise infringe any patent claims
|
||||
they can license or become able to license.
|
||||
|
||||
## Reliability
|
||||
|
||||
No contributor can revoke this license.
|
||||
|
||||
## No Liability
|
||||
|
||||
**_As far as the law allows, this software comes as is,
|
||||
without any warranty or condition, and no contributor
|
||||
will be liable to anyone for any damages related to this
|
||||
software or this license, under any kind of legal claim._**
|
||||
528
electron/node_modules/rimraf/node_modules/minimatch/README.md
generated
vendored
528
electron/node_modules/rimraf/node_modules/minimatch/README.md
generated
vendored
|
|
@ -1,528 +0,0 @@
|
|||
# minimatch
|
||||
|
||||
A minimal matching utility.
|
||||
|
||||
This is the matching library used internally by npm.
|
||||
|
||||
It works by converting glob expressions into JavaScript `RegExp`
|
||||
objects.
|
||||
|
||||
## Important Security Consideration!
|
||||
|
||||
> [!WARNING]
|
||||
> This library uses JavaScript regular expressions. Please read
|
||||
> the following warning carefully, and be thoughtful about what
|
||||
> you provide to this library in production systems.
|
||||
|
||||
_Any_ library in JavaScript that deals with matching string
|
||||
patterns using regular expressions will be subject to
|
||||
[ReDoS](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS)
|
||||
if the pattern is generated using untrusted input.
|
||||
|
||||
Efforts have been made to mitigate risk as much as is feasible in
|
||||
such a library, providing maximum recursion depths and so forth,
|
||||
but these measures can only ultimately protect against accidents,
|
||||
not malice. A dedicated attacker can _always_ find patterns that
|
||||
cannot be defended against by a bash-compatible glob pattern
|
||||
matching system that uses JavaScript regular expressions.
|
||||
|
||||
To be extremely clear:
|
||||
|
||||
> [!WARNING]
|
||||
> **If you create a system where you take user input, and use
|
||||
> that input as the source of a Regular Expression pattern, in
|
||||
> this or any extant glob matcher in JavaScript, you will be
|
||||
> pwned.**
|
||||
|
||||
A future version of this library _may_ use a different matching
|
||||
algorithm which does not exhibit backtracking problems. If and
|
||||
when that happens, it will likely be a sweeping change, and those
|
||||
improvements will **not** be backported to legacy versions.
|
||||
|
||||
In the near term, it is not reasonable to continue to play
|
||||
whack-a-mole with security advisories, and so any future ReDoS
|
||||
reports will be considered "working as intended", and resolved
|
||||
entirely by this warning.
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// hybrid module, load with require() or import
|
||||
import { minimatch } from 'minimatch'
|
||||
// or:
|
||||
const { minimatch } = require('minimatch')
|
||||
|
||||
minimatch('bar.foo', '*.foo') // true!
|
||||
minimatch('bar.foo', '*.bar') // false!
|
||||
minimatch('bar.foo', '*.+(bar|foo)', { debug: true }) // true, and noisy!
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
Supports these glob features:
|
||||
|
||||
- Brace Expansion
|
||||
- Extended glob matching
|
||||
- "Globstar" `**` matching
|
||||
- [Posix character
|
||||
classes](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html),
|
||||
like `[[:alpha:]]`, supporting the full range of Unicode
|
||||
characters. For example, `[[:alpha:]]` will match against
|
||||
`'é'`, though `[a-zA-Z]` will not. Collating symbol and set
|
||||
matching is not supported, so `[[=e=]]` will _not_ match `'é'`
|
||||
and `[[.ch.]]` will not match `'ch'` in locales where `ch` is
|
||||
considered a single character.
|
||||
|
||||
See:
|
||||
|
||||
- `man sh`
|
||||
- `man bash` [Pattern
|
||||
Matching](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html)
|
||||
- `man 3 fnmatch`
|
||||
- `man 5 gitignore`
|
||||
|
||||
## Windows
|
||||
|
||||
**Please only use forward-slashes in glob expressions.**
|
||||
|
||||
Though windows uses either `/` or `\` as its path separator, only `/`
|
||||
characters are used by this glob implementation. You must use
|
||||
forward-slashes **only** in glob expressions. Back-slashes in patterns
|
||||
will always be interpreted as escape characters, not path separators.
|
||||
|
||||
Note that `\` or `/` _will_ be interpreted as path separators in paths on
|
||||
Windows, and will match against `/` in glob expressions.
|
||||
|
||||
So just always use `/` in patterns.
|
||||
|
||||
### UNC Paths
|
||||
|
||||
On Windows, UNC paths like `//?/c:/...` or
|
||||
`//ComputerName/Share/...` are handled specially.
|
||||
|
||||
- Patterns starting with a double-slash followed by some
|
||||
non-slash characters will preserve their double-slash. As a
|
||||
result, a pattern like `//*` will match `//x`, but not `/x`.
|
||||
- Patterns staring with `//?/<drive letter>:` will _not_ treat
|
||||
the `?` as a wildcard character. Instead, it will be treated
|
||||
as a normal string.
|
||||
- Patterns starting with `//?/<drive letter>:/...` will match
|
||||
file paths starting with `<drive letter>:/...`, and vice versa,
|
||||
as if the `//?/` was not present. This behavior only is
|
||||
present when the drive letters are a case-insensitive match to
|
||||
one another. The remaining portions of the path/pattern are
|
||||
compared case sensitively, unless `nocase:true` is set.
|
||||
|
||||
Note that specifying a UNC path using `\` characters as path
|
||||
separators is always allowed in the file path argument, but only
|
||||
allowed in the pattern argument when `windowsPathsNoEscape: true`
|
||||
is set in the options.
|
||||
|
||||
## Minimatch Class
|
||||
|
||||
Create a minimatch object by instantiating the `minimatch.Minimatch` class.
|
||||
|
||||
```javascript
|
||||
var Minimatch = require('minimatch').Minimatch
|
||||
var mm = new Minimatch(pattern, options)
|
||||
```
|
||||
|
||||
### Properties
|
||||
|
||||
- `pattern` The original pattern the minimatch object represents.
|
||||
- `options` The options supplied to the constructor.
|
||||
- `set` A 2-dimensional array of regexp or string expressions.
|
||||
Each row in the
|
||||
array corresponds to a brace-expanded pattern. Each item in the row
|
||||
corresponds to a single path-part. For example, the pattern
|
||||
`{a,b/c}/d` would expand to a set of patterns like:
|
||||
|
||||
[ [ a, d ]
|
||||
, [ b, c, d ] ]
|
||||
|
||||
If a portion of the pattern doesn't have any "magic" in it
|
||||
(that is, it's something like `"foo"` rather than `fo*o?`), then it
|
||||
will be left as a string rather than converted to a regular
|
||||
expression.
|
||||
|
||||
- `regexp` Created by the `makeRe` method. A single regular expression
|
||||
expressing the entire pattern. This is useful in cases where you wish
|
||||
to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.
|
||||
- `negate` True if the pattern is negated.
|
||||
- `comment` True if the pattern is a comment.
|
||||
- `empty` True if the pattern is `""`.
|
||||
|
||||
### Methods
|
||||
|
||||
- `makeRe()` Generate the `regexp` member if necessary, and return it.
|
||||
Will return `false` if the pattern is invalid.
|
||||
- `match(fname)` Return true if the filename matches the pattern, or
|
||||
false otherwise.
|
||||
- `matchOne(fileArray, patternArray, partial)` Take a `/`-split
|
||||
filename, and match it against a single row in the `regExpSet`. This
|
||||
method is mainly for internal use, but is exposed so that it can be
|
||||
used by a glob-walker that needs to avoid excessive filesystem calls.
|
||||
- `hasMagic()` Returns true if the parsed pattern contains any
|
||||
magic characters. Returns false if all comparator parts are
|
||||
string literals. If the `magicalBraces` option is set on the
|
||||
constructor, then it will consider brace expansions which are
|
||||
not otherwise magical to be magic. If not set, then a pattern
|
||||
like `a{b,c}d` will return `false`, because neither `abd` nor
|
||||
`acd` contain any special glob characters.
|
||||
|
||||
This does **not** mean that the pattern string can be used as a
|
||||
literal filename, as it may contain magic glob characters that
|
||||
are escaped. For example, the pattern `\\*` or `[*]` would not
|
||||
be considered to have magic, as the matching portion parses to
|
||||
the literal string `'*'` and would match a path named `'*'`,
|
||||
not `'\\*'` or `'[*]'`. The `minimatch.unescape()` method may
|
||||
be used to remove escape characters.
|
||||
|
||||
All other methods are internal, and will be called as necessary.
|
||||
|
||||
### minimatch(path, pattern, options)
|
||||
|
||||
Main export. Tests a path against the pattern using the options.
|
||||
|
||||
```javascript
|
||||
var isJS = minimatch(file, '*.js', { matchBase: true })
|
||||
```
|
||||
|
||||
### minimatch.filter(pattern, options)
|
||||
|
||||
Returns a function that tests its
|
||||
supplied argument, suitable for use with `Array.filter`. Example:
|
||||
|
||||
```javascript
|
||||
var javascripts = fileList.filter(
|
||||
minimatch.filter('*.js', { matchBase: true }),
|
||||
)
|
||||
```
|
||||
|
||||
### minimatch.escape(pattern, options = {})
|
||||
|
||||
Escape all magic characters in a glob pattern, so that it will
|
||||
only ever match literal strings.
|
||||
|
||||
If the `windowsPathsNoEscape` option is used, then characters are
|
||||
escaped by wrapping in `[]`, because a magic character wrapped in
|
||||
a character class can only be satisfied by that exact character.
|
||||
|
||||
Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot
|
||||
be escaped or unescaped.
|
||||
|
||||
### minimatch.unescape(pattern, options = {})
|
||||
|
||||
Un-escape a glob string that may contain some escaped characters.
|
||||
|
||||
If the `windowsPathsNoEscape` option is used, then square-brace
|
||||
escapes are removed, but not backslash escapes. For example, it
|
||||
will turn the string `'[*]'` into `*`, but it will not turn
|
||||
`'\\*'` into `'*'`, because `\` is a path separator in
|
||||
`windowsPathsNoEscape` mode.
|
||||
|
||||
When `windowsPathsNoEscape` is not set, then both brace escapes
|
||||
and backslash escapes are removed.
|
||||
|
||||
Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot
|
||||
be escaped or unescaped.
|
||||
|
||||
### minimatch.match(list, pattern, options)
|
||||
|
||||
Match against the list of
|
||||
files, in the style of fnmatch or glob. If nothing is matched, and
|
||||
options.nonull is set, then return a list containing the pattern itself.
|
||||
|
||||
```javascript
|
||||
var javascripts = minimatch.match(fileList, '*.js', { matchBase: true })
|
||||
```
|
||||
|
||||
### minimatch.makeRe(pattern, options)
|
||||
|
||||
Make a regular expression object from the pattern.
|
||||
|
||||
## Options
|
||||
|
||||
All options are `false` by default.
|
||||
|
||||
### debug
|
||||
|
||||
Dump a ton of stuff to stderr.
|
||||
|
||||
### nobrace
|
||||
|
||||
Do not expand `{a,b}` and `{1..3}` brace sets.
|
||||
|
||||
### noglobstar
|
||||
|
||||
Disable `**` matching against multiple folder names.
|
||||
|
||||
### dot
|
||||
|
||||
Allow patterns to match filenames starting with a period, even if
|
||||
the pattern does not explicitly have a period in that spot.
|
||||
|
||||
Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`
|
||||
is set.
|
||||
|
||||
### noext
|
||||
|
||||
Disable "extglob" style patterns like `+(a|b)`.
|
||||
|
||||
### nocase
|
||||
|
||||
Perform a case-insensitive match.
|
||||
|
||||
### nocaseMagicOnly
|
||||
|
||||
When used with `{nocase: true}`, create regular expressions that
|
||||
are case-insensitive, but leave string match portions untouched.
|
||||
Has no effect when used without `{nocase: true}`.
|
||||
|
||||
Useful when some other form of case-insensitive matching is used,
|
||||
or if the original string representation is useful in some other
|
||||
way.
|
||||
|
||||
### nonull
|
||||
|
||||
When a match is not found by `minimatch.match`, return a list containing
|
||||
the pattern itself if this option is set. When not set, an empty list
|
||||
is returned if there are no matches.
|
||||
|
||||
### magicalBraces
|
||||
|
||||
This only affects the results of the `Minimatch.hasMagic` method.
|
||||
|
||||
If the pattern contains brace expansions, such as `a{b,c}d`, but
|
||||
no other magic characters, then the `Minimatch.hasMagic()` method
|
||||
will return `false` by default. When this option set, it will
|
||||
return `true` for brace expansion as well as other magic glob
|
||||
characters.
|
||||
|
||||
### matchBase
|
||||
|
||||
If set, then patterns without slashes will be matched
|
||||
against the basename of the path if it contains slashes. For example,
|
||||
`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.
|
||||
|
||||
### nocomment
|
||||
|
||||
Suppress the behavior of treating `#` at the start of a pattern as a
|
||||
comment.
|
||||
|
||||
### nonegate
|
||||
|
||||
Suppress the behavior of treating a leading `!` character as negation.
|
||||
|
||||
### flipNegate
|
||||
|
||||
Returns from negate expressions the same as if they were not negated.
|
||||
(Ie, true on a hit, false on a miss.)
|
||||
|
||||
### partial
|
||||
|
||||
Compare a partial path to a pattern. As long as the parts of the path that
|
||||
are present are not contradicted by the pattern, it will be treated as a
|
||||
match. This is useful in applications where you're walking through a
|
||||
folder structure, and don't yet have the full path, but want to ensure that
|
||||
you do not walk down paths that can never be a match.
|
||||
|
||||
For example,
|
||||
|
||||
```js
|
||||
minimatch('/a/b', '/a/*/c/d', { partial: true }) // true, might be /a/b/c/d
|
||||
minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d
|
||||
minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a
|
||||
```
|
||||
|
||||
### windowsPathsNoEscape
|
||||
|
||||
Use `\\` as a path separator _only_, and _never_ as an escape
|
||||
character. If set, all `\\` characters are replaced with `/` in
|
||||
the pattern. Note that this makes it **impossible** to match
|
||||
against paths containing literal glob pattern characters, but
|
||||
allows matching with patterns constructed using `path.join()` and
|
||||
`path.resolve()` on Windows platforms, mimicking the (buggy!)
|
||||
behavior of earlier versions on Windows. Please use with
|
||||
caution, and be mindful of [the caveat about Windows
|
||||
paths](#windows).
|
||||
|
||||
For legacy reasons, this is also set if
|
||||
`options.allowWindowsEscape` is set to the exact value `false`.
|
||||
|
||||
### windowsNoMagicRoot
|
||||
|
||||
When a pattern starts with a UNC path or drive letter, and in
|
||||
`nocase:true` mode, do not convert the root portions of the
|
||||
pattern into a case-insensitive regular expression, and instead
|
||||
leave them as strings.
|
||||
|
||||
This is the default when the platform is `win32` and
|
||||
`nocase:true` is set.
|
||||
|
||||
### preserveMultipleSlashes
|
||||
|
||||
By default, multiple `/` characters (other than the leading `//`
|
||||
in a UNC path, see "UNC Paths" above) are treated as a single
|
||||
`/`.
|
||||
|
||||
That is, a pattern like `a///b` will match the file path `a/b`.
|
||||
|
||||
Set `preserveMultipleSlashes: true` to suppress this behavior.
|
||||
|
||||
### optimizationLevel
|
||||
|
||||
A number indicating the level of optimization that should be done
|
||||
to the pattern prior to parsing and using it for matches.
|
||||
|
||||
Globstar parts `**` are always converted to `*` when `noglobstar`
|
||||
is set, and multiple adjacent `**` parts are converted into a
|
||||
single `**` (ie, `a/**/**/b` will be treated as `a/**/b`, as this
|
||||
is equivalent in all cases).
|
||||
|
||||
- `0` - Make no further changes. In this mode, `.` and `..` are
|
||||
maintained in the pattern, meaning that they must also appear
|
||||
in the same position in the test path string. Eg, a pattern
|
||||
like `a/*/../c` will match the string `a/b/../c` but not the
|
||||
string `a/c`.
|
||||
- `1` - (default) Remove cases where a double-dot `..` follows a
|
||||
pattern portion that is not `**`, `.`, `..`, or empty `''`. For
|
||||
example, the pattern `./a/b/../*` is converted to `./a/*`, and
|
||||
so it will match the path string `./a/c`, but not the path
|
||||
string `./a/b/../c`. Dots and empty path portions in the
|
||||
pattern are preserved.
|
||||
- `2` (or higher) - Much more aggressive optimizations, suitable
|
||||
for use with file-walking cases:
|
||||
- Remove cases where a double-dot `..` follows a pattern
|
||||
portion that is not `**`, `.`, or empty `''`. Remove empty
|
||||
and `.` portions of the pattern, where safe to do so (ie,
|
||||
anywhere other than the last position, the first position, or
|
||||
the second position in a pattern starting with `/`, as this
|
||||
may indicate a UNC path on Windows).
|
||||
- Convert patterns containing `<pre>/**/../<p>/<rest>` into the
|
||||
equivalent `<pre>/{..,**}/<p>/<rest>`, where `<p>` is a
|
||||
a pattern portion other than `.`, `..`, `**`, or empty
|
||||
`''`.
|
||||
- Dedupe patterns where a `**` portion is present in one and
|
||||
omitted in another, and it is not the final path portion, and
|
||||
they are otherwise equivalent. So `{a/**/b,a/b}` becomes
|
||||
`a/**/b`, because `**` matches against an empty path portion.
|
||||
- Dedupe patterns where a `*` portion is present in one, and a
|
||||
non-dot pattern other than `**`, `.`, `..`, or `''` is in the
|
||||
same position in the other. So `a/{*,x}/b` becomes `a/*/b`,
|
||||
because `*` can match against `x`.
|
||||
|
||||
While these optimizations improve the performance of
|
||||
file-walking use cases such as [glob](http://npm.im/glob) (ie,
|
||||
the reason this module exists), there are cases where it will
|
||||
fail to match a literal string that would have been matched in
|
||||
optimization level 1 or 0.
|
||||
|
||||
Specifically, while the `Minimatch.match()` method will
|
||||
optimize the file path string in the same ways, resulting in
|
||||
the same matches, it will fail when tested with the regular
|
||||
expression provided by `Minimatch.makeRe()`, unless the path
|
||||
string is first processed with
|
||||
`minimatch.levelTwoFileOptimize()` or similar.
|
||||
|
||||
### platform
|
||||
|
||||
When set to `win32`, this will trigger all windows-specific
|
||||
behaviors (special handling for UNC paths, and treating `\` as
|
||||
separators in file paths for comparison.)
|
||||
|
||||
Defaults to the value of `process.platform`.
|
||||
|
||||
### maxGlobstarRecursion
|
||||
|
||||
Max number of non-adjacent `**` patterns to recursively walk
|
||||
down.
|
||||
|
||||
The default of `200` is almost certainly high enough for most
|
||||
purposes, and can handle absurdly excessive patterns.
|
||||
|
||||
If the limit is exceeded (which would require very excessively
|
||||
long patterns and paths containing lots of `**` patterns!), then
|
||||
it is treated as non-matching, even if the path would normally
|
||||
match the pattern provided.
|
||||
|
||||
That is, this is an intentional false negative, deemed an
|
||||
acceptable break in correctness for security and performance.
|
||||
|
||||
### maxExtglobRecursion
|
||||
|
||||
Max depth to traverse for nested extglobs like `*(a|b|c)`
|
||||
|
||||
Default is 2, which is quite low, but any higher value swiftly
|
||||
results in punishing performance impacts. Note that this is _not_
|
||||
relevant when the globstar types can be safely coalesced into a
|
||||
single set.
|
||||
|
||||
For example, `*(a|@(b|c)|d)` would be flattened into
|
||||
`*(a|b|c|d)`. Thus, many common extglobs will retain good
|
||||
performance and never hit this limit, even if they are
|
||||
excessively deep and complicated.
|
||||
|
||||
If the limit is hit, then the extglob characters are simply not
|
||||
parsed, and the pattern effectively switches into `noextglob:
|
||||
true` mode for the contents of that nested sub-pattern. This will
|
||||
typically _not_ result in a match, but is considered a valid
|
||||
trade-off for security and performance.
|
||||
|
||||
## Comparisons to other fnmatch/glob implementations
|
||||
|
||||
While strict compliance with the existing standards is a
|
||||
worthwhile goal, some discrepancies exist between minimatch and
|
||||
other implementations. Some are intentional, and some are
|
||||
unavoidable.
|
||||
|
||||
If the pattern starts with a `!` character, then it is negated. Set the
|
||||
`nonegate` flag to suppress this behavior, and treat leading `!`
|
||||
characters normally. This is perhaps relevant if you wish to start the
|
||||
pattern with a negative extglob pattern like `!(a|B)`. Multiple `!`
|
||||
characters at the start of a pattern will negate the pattern multiple
|
||||
times.
|
||||
|
||||
If a pattern starts with `#`, then it is treated as a comment, and
|
||||
will not match anything. Use `\#` to match a literal `#` at the
|
||||
start of a line, or set the `nocomment` flag to suppress this behavior.
|
||||
|
||||
The double-star character `**` is supported by default, unless the
|
||||
`noglobstar` flag is set. This is supported in the manner of bsdglob
|
||||
and bash 4.1, where `**` only has special significance if it is the only
|
||||
thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but
|
||||
`a/**b` will not.
|
||||
|
||||
If an escaped pattern has no matches, and the `nonull` flag is set,
|
||||
then minimatch.match returns the pattern as-provided, rather than
|
||||
interpreting the character escapes. For example,
|
||||
`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
|
||||
`"*a?"`. This is akin to setting the `nullglob` option in bash, except
|
||||
that it does not resolve escaped pattern characters.
|
||||
|
||||
If brace expansion is not disabled, then it is performed before any
|
||||
other interpretation of the glob pattern. Thus, a pattern like
|
||||
`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded
|
||||
**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are
|
||||
checked for validity. Since those two are valid, matching proceeds.
|
||||
|
||||
Negated extglob patterns are handled as closely as possible to
|
||||
Bash semantics, but there are some cases with negative extglobs
|
||||
which are exceedingly difficult to express in a JavaScript
|
||||
regular expression. In particular the negated pattern
|
||||
`<start>!(<pattern>*|)*` will in bash match anything that does
|
||||
not start with `<start><pattern>`. However,
|
||||
`<start>!(<pattern>*)*` _will_ match paths starting with
|
||||
`<start><pattern>`, because the empty string can match against
|
||||
the negated portion. In this library, `<start>!(<pattern>*|)*`
|
||||
will _not_ match any pattern starting with `<start>`, due to a
|
||||
difference in precisely which patterns are considered "greedy" in
|
||||
Regular Expressions vs bash path expansion. This may be fixable,
|
||||
but not without incurring some complexity and performance costs,
|
||||
and the trade-off seems to not be worth pursuing.
|
||||
|
||||
Note that `fnmatch(3)` in libc is an extremely naive string comparison
|
||||
matcher, which does not do anything special for slashes. This library is
|
||||
designed to be used in glob searching and file walkers, and so it does do
|
||||
special things with `/`. Thus, `foo*` will not match `foo/bar` in this
|
||||
library, even though it would in `fnmatch(3)`.
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
export declare const assertValidPattern: (pattern: unknown) => void;
|
||||
//# sourceMappingURL=assert-valid-pattern.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"assert-valid-pattern.d.ts","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAUtD,CAAA"}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.assertValidPattern = void 0;
|
||||
const MAX_PATTERN_LENGTH = 1024 * 64;
|
||||
const assertValidPattern = (pattern) => {
|
||||
if (typeof pattern !== 'string') {
|
||||
throw new TypeError('invalid pattern');
|
||||
}
|
||||
if (pattern.length > MAX_PATTERN_LENGTH) {
|
||||
throw new TypeError('pattern is too long');
|
||||
}
|
||||
};
|
||||
exports.assertValidPattern = assertValidPattern;
|
||||
//# sourceMappingURL=assert-valid-pattern.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"assert-valid-pattern.js","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":";;;AAAA,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAA;AAC7B,MAAM,kBAAkB,GAA+B,CAC5D,OAAgB,EACW,EAAE;IAC7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAA;IACxC,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,kBAAkB,EAAE,CAAC;QACxC,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC,CAAA;AAVY,QAAA,kBAAkB,sBAU9B","sourcesContent":["const MAX_PATTERN_LENGTH = 1024 * 64\nexport const assertValidPattern: (pattern: unknown) => void = (\n pattern: unknown,\n): asserts pattern is string => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern')\n }\n\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long')\n }\n}\n"]}
|
||||
22
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/ast.d.ts
generated
vendored
22
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/ast.d.ts
generated
vendored
|
|
@ -1,22 +0,0 @@
|
|||
import type { MinimatchOptions, MMRegExp } from './index.js';
|
||||
export type ExtglobType = '!' | '?' | '+' | '*' | '@';
|
||||
export declare class AST {
|
||||
#private;
|
||||
type: ExtglobType | null;
|
||||
id: number;
|
||||
get depth(): number;
|
||||
constructor(type: ExtglobType | null, parent?: AST, options?: MinimatchOptions);
|
||||
get hasMagic(): boolean | undefined;
|
||||
toString(): string;
|
||||
push(...parts: (string | AST)[]): void;
|
||||
toJSON(): unknown[];
|
||||
isStart(): boolean;
|
||||
isEnd(): boolean;
|
||||
copyIn(part: AST | string): void;
|
||||
clone(parent: AST): AST;
|
||||
static fromGlob(pattern: string, options?: MinimatchOptions): AST;
|
||||
toMMPattern(): MMRegExp | string;
|
||||
get options(): MinimatchOptions;
|
||||
toRegExpSource(allowDot?: boolean): [re: string, body: string, hasMagic: boolean, uflag: boolean];
|
||||
}
|
||||
//# sourceMappingURL=ast.d.ts.map
|
||||
1
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/ast.d.ts.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/ast.d.ts.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAwC5D,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AAgJrD,qBAAa,GAAG;;IACd,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;IAexB,EAAE,SAAO;IAET,IAAI,KAAK,IAAI,MAAM,CAElB;gBAgBC,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,MAAM,CAAC,EAAE,GAAG,EACZ,OAAO,GAAE,gBAAqB;IAahC,IAAI,QAAQ,IAAI,OAAO,GAAG,SAAS,CAUlC;IAGD,QAAQ,IAAI,MAAM;IAkDlB,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE;IAe/B,MAAM;IAkBN,OAAO,IAAI,OAAO;IAgBlB,KAAK,IAAI,OAAO;IAYhB,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAKzB,KAAK,CAAC,MAAM,EAAE,GAAG;IAsQjB,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAQ/D,WAAW,IAAI,QAAQ,GAAG,MAAM;IA2BhC,IAAI,OAAO,qBAEV;IAuED,cAAc,CACZ,QAAQ,CAAC,EAAE,OAAO,GACjB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC;CA6OjE"}
|
||||
845
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/ast.js
generated
vendored
845
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/ast.js
generated
vendored
|
|
@ -1,845 +0,0 @@
|
|||
"use strict";
|
||||
// parse a single path portion
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AST = void 0;
|
||||
const brace_expressions_js_1 = require("./brace-expressions.js");
|
||||
const unescape_js_1 = require("./unescape.js");
|
||||
const types = new Set(['!', '?', '+', '*', '@']);
|
||||
const isExtglobType = (c) => types.has(c);
|
||||
const isExtglobAST = (c) => isExtglobType(c.type);
|
||||
// Map of which extglob types can adopt the children of a nested extglob
|
||||
//
|
||||
// anything but ! can adopt a matching type:
|
||||
// +(a|+(b|c)|d) => +(a|b|c|d)
|
||||
// *(a|*(b|c)|d) => *(a|b|c|d)
|
||||
// @(a|@(b|c)|d) => @(a|b|c|d)
|
||||
// ?(a|?(b|c)|d) => ?(a|b|c|d)
|
||||
//
|
||||
// * can adopt anything, because 0 or repetition is allowed
|
||||
// *(a|?(b|c)|d) => *(a|b|c|d)
|
||||
// *(a|+(b|c)|d) => *(a|b|c|d)
|
||||
// *(a|@(b|c)|d) => *(a|b|c|d)
|
||||
//
|
||||
// + can adopt @, because 1 or repetition is allowed
|
||||
// +(a|@(b|c)|d) => +(a|b|c|d)
|
||||
//
|
||||
// + and @ CANNOT adopt *, because 0 would be allowed
|
||||
// +(a|*(b|c)|d) => would match "", on *(b|c)
|
||||
// @(a|*(b|c)|d) => would match "", on *(b|c)
|
||||
//
|
||||
// + and @ CANNOT adopt ?, because 0 would be allowed
|
||||
// +(a|?(b|c)|d) => would match "", on ?(b|c)
|
||||
// @(a|?(b|c)|d) => would match "", on ?(b|c)
|
||||
//
|
||||
// ? can adopt @, because 0 or 1 is allowed
|
||||
// ?(a|@(b|c)|d) => ?(a|b|c|d)
|
||||
//
|
||||
// ? and @ CANNOT adopt * or +, because >1 would be allowed
|
||||
// ?(a|*(b|c)|d) => would match bbb on *(b|c)
|
||||
// @(a|*(b|c)|d) => would match bbb on *(b|c)
|
||||
// ?(a|+(b|c)|d) => would match bbb on +(b|c)
|
||||
// @(a|+(b|c)|d) => would match bbb on +(b|c)
|
||||
//
|
||||
// ! CANNOT adopt ! (nothing else can either)
|
||||
// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)
|
||||
//
|
||||
// ! can adopt @
|
||||
// !(a|@(b|c)|d) => !(a|b|c|d)
|
||||
//
|
||||
// ! CANNOT adopt *
|
||||
// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed
|
||||
//
|
||||
// ! CANNOT adopt +
|
||||
// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed
|
||||
//
|
||||
// ! CANNOT adopt ?
|
||||
// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match "x"
|
||||
const adoptionMap = new Map([
|
||||
['!', ['@']],
|
||||
['?', ['?', '@']],
|
||||
['@', ['@']],
|
||||
['*', ['*', '+', '?', '@']],
|
||||
['+', ['+', '@']],
|
||||
]);
|
||||
// nested extglobs that can be adopted in, but with the addition of
|
||||
// a blank '' element.
|
||||
const adoptionWithSpaceMap = new Map([
|
||||
['!', ['?']],
|
||||
['@', ['?']],
|
||||
['+', ['?', '*']],
|
||||
]);
|
||||
// union of the previous two maps
|
||||
const adoptionAnyMap = new Map([
|
||||
['!', ['?', '@']],
|
||||
['?', ['?', '@']],
|
||||
['@', ['?', '@']],
|
||||
['*', ['*', '+', '?', '@']],
|
||||
['+', ['+', '@', '?', '*']],
|
||||
]);
|
||||
// Extglobs that can take over their parent if they are the only child
|
||||
// the key is parent, value maps child to resulting extglob parent type
|
||||
// '@' is omitted because it's a special case. An `@` extglob with a single
|
||||
// member can always be usurped by that subpattern.
|
||||
const usurpMap = new Map([
|
||||
['!', new Map([['!', '@']])],
|
||||
[
|
||||
'?',
|
||||
new Map([
|
||||
['*', '*'],
|
||||
['+', '*'],
|
||||
]),
|
||||
],
|
||||
[
|
||||
'@',
|
||||
new Map([
|
||||
['!', '!'],
|
||||
['?', '?'],
|
||||
['@', '@'],
|
||||
['*', '*'],
|
||||
['+', '+'],
|
||||
]),
|
||||
],
|
||||
[
|
||||
'+',
|
||||
new Map([
|
||||
['?', '*'],
|
||||
['*', '*'],
|
||||
]),
|
||||
],
|
||||
]);
|
||||
// Patterns that get prepended to bind to the start of either the
|
||||
// entire string, or just a single path portion, to prevent dots
|
||||
// and/or traversal patterns, when needed.
|
||||
// Exts don't need the ^ or / bit, because the root binds that already.
|
||||
const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))';
|
||||
const startNoDot = '(?!\\.)';
|
||||
// characters that indicate a start of pattern needs the "no dots" bit,
|
||||
// because a dot *might* be matched. ( is not in the list, because in
|
||||
// the case of a child extglob, it will handle the prevention itself.
|
||||
const addPatternStart = new Set(['[', '.']);
|
||||
// cases where traversal is A-OK, no dot prevention needed
|
||||
const justDots = new Set(['..', '.']);
|
||||
const reSpecials = new Set('().*{}+?[]^$\\!');
|
||||
const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
||||
// any single thing other than /
|
||||
const qmark = '[^/]';
|
||||
// * => any number of characters
|
||||
const star = qmark + '*?';
|
||||
// use + when we need to ensure that *something* matches, because the * is
|
||||
// the only thing in the path portion.
|
||||
const starNoEmpty = qmark + '+?';
|
||||
// remove the \ chars that we added if we end up doing a nonmagic compare
|
||||
// const deslash = (s: string) => s.replace(/\\(.)/g, '$1')
|
||||
let ID = 0;
|
||||
class AST {
|
||||
type;
|
||||
#root;
|
||||
#hasMagic;
|
||||
#uflag = false;
|
||||
#parts = [];
|
||||
#parent;
|
||||
#parentIndex;
|
||||
#negs;
|
||||
#filledNegs = false;
|
||||
#options;
|
||||
#toString;
|
||||
// set to true if it's an extglob with no children
|
||||
// (which really means one child of '')
|
||||
#emptyExt = false;
|
||||
id = ++ID;
|
||||
get depth() {
|
||||
return (this.#parent?.depth ?? -1) + 1;
|
||||
}
|
||||
[Symbol.for('nodejs.util.inspect.custom')]() {
|
||||
return {
|
||||
'@@type': 'AST',
|
||||
id: this.id,
|
||||
type: this.type,
|
||||
root: this.#root.id,
|
||||
parent: this.#parent?.id,
|
||||
depth: this.depth,
|
||||
partsLength: this.#parts.length,
|
||||
parts: this.#parts,
|
||||
};
|
||||
}
|
||||
constructor(type, parent, options = {}) {
|
||||
this.type = type;
|
||||
// extglobs are inherently magical
|
||||
if (type)
|
||||
this.#hasMagic = true;
|
||||
this.#parent = parent;
|
||||
this.#root = this.#parent ? this.#parent.#root : this;
|
||||
this.#options = this.#root === this ? options : this.#root.#options;
|
||||
this.#negs = this.#root === this ? [] : this.#root.#negs;
|
||||
if (type === '!' && !this.#root.#filledNegs)
|
||||
this.#negs.push(this);
|
||||
this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
|
||||
}
|
||||
get hasMagic() {
|
||||
/* c8 ignore start */
|
||||
if (this.#hasMagic !== undefined)
|
||||
return this.#hasMagic;
|
||||
/* c8 ignore stop */
|
||||
for (const p of this.#parts) {
|
||||
if (typeof p === 'string')
|
||||
continue;
|
||||
if (p.type || p.hasMagic)
|
||||
return (this.#hasMagic = true);
|
||||
}
|
||||
// note: will be undefined until we generate the regexp src and find out
|
||||
return this.#hasMagic;
|
||||
}
|
||||
// reconstructs the pattern
|
||||
toString() {
|
||||
return (this.#toString !== undefined ? this.#toString
|
||||
: !this.type ?
|
||||
(this.#toString = this.#parts.map(p => String(p)).join(''))
|
||||
: (this.#toString =
|
||||
this.type +
|
||||
'(' +
|
||||
this.#parts.map(p => String(p)).join('|') +
|
||||
')'));
|
||||
}
|
||||
#fillNegs() {
|
||||
/* c8 ignore start */
|
||||
if (this !== this.#root)
|
||||
throw new Error('should only call on root');
|
||||
if (this.#filledNegs)
|
||||
return this;
|
||||
/* c8 ignore stop */
|
||||
// call toString() once to fill this out
|
||||
this.toString();
|
||||
this.#filledNegs = true;
|
||||
let n;
|
||||
while ((n = this.#negs.pop())) {
|
||||
if (n.type !== '!')
|
||||
continue;
|
||||
// walk up the tree, appending everthing that comes AFTER parentIndex
|
||||
let p = n;
|
||||
let pp = p.#parent;
|
||||
while (pp) {
|
||||
for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {
|
||||
for (const part of n.#parts) {
|
||||
/* c8 ignore start */
|
||||
if (typeof part === 'string') {
|
||||
throw new Error('string part in extglob AST??');
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
part.copyIn(pp.#parts[i]);
|
||||
}
|
||||
}
|
||||
p = pp;
|
||||
pp = p.#parent;
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
push(...parts) {
|
||||
for (const p of parts) {
|
||||
if (p === '')
|
||||
continue;
|
||||
/* c8 ignore start */
|
||||
if (typeof p !== 'string' &&
|
||||
!(p instanceof _a && p.#parent === this)) {
|
||||
throw new Error('invalid part: ' + p);
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
this.#parts.push(p);
|
||||
}
|
||||
}
|
||||
toJSON() {
|
||||
const ret = this.type === null ?
|
||||
this.#parts
|
||||
.slice()
|
||||
.map(p => (typeof p === 'string' ? p : p.toJSON()))
|
||||
: [this.type, ...this.#parts.map(p => p.toJSON())];
|
||||
if (this.isStart() && !this.type)
|
||||
ret.unshift([]);
|
||||
if (this.isEnd() &&
|
||||
(this === this.#root ||
|
||||
(this.#root.#filledNegs && this.#parent?.type === '!'))) {
|
||||
ret.push({});
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
isStart() {
|
||||
if (this.#root === this)
|
||||
return true;
|
||||
// if (this.type) return !!this.#parent?.isStart()
|
||||
if (!this.#parent?.isStart())
|
||||
return false;
|
||||
if (this.#parentIndex === 0)
|
||||
return true;
|
||||
// if everything AHEAD of this is a negation, then it's still the "start"
|
||||
const p = this.#parent;
|
||||
for (let i = 0; i < this.#parentIndex; i++) {
|
||||
const pp = p.#parts[i];
|
||||
if (!(pp instanceof _a && pp.type === '!')) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
isEnd() {
|
||||
if (this.#root === this)
|
||||
return true;
|
||||
if (this.#parent?.type === '!')
|
||||
return true;
|
||||
if (!this.#parent?.isEnd())
|
||||
return false;
|
||||
if (!this.type)
|
||||
return this.#parent?.isEnd();
|
||||
// if not root, it'll always have a parent
|
||||
/* c8 ignore start */
|
||||
const pl = this.#parent ? this.#parent.#parts.length : 0;
|
||||
/* c8 ignore stop */
|
||||
return this.#parentIndex === pl - 1;
|
||||
}
|
||||
copyIn(part) {
|
||||
if (typeof part === 'string')
|
||||
this.push(part);
|
||||
else
|
||||
this.push(part.clone(this));
|
||||
}
|
||||
clone(parent) {
|
||||
const c = new _a(this.type, parent);
|
||||
for (const p of this.#parts) {
|
||||
c.copyIn(p);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
static #parseAST(str, ast, pos, opt, extDepth) {
|
||||
const maxDepth = opt.maxExtglobRecursion ?? 2;
|
||||
let escaping = false;
|
||||
let inBrace = false;
|
||||
let braceStart = -1;
|
||||
let braceNeg = false;
|
||||
if (ast.type === null) {
|
||||
// outside of a extglob, append until we find a start
|
||||
let i = pos;
|
||||
let acc = '';
|
||||
while (i < str.length) {
|
||||
const c = str.charAt(i++);
|
||||
// still accumulate escapes at this point, but we do ignore
|
||||
// starts that are escaped
|
||||
if (escaping || c === '\\') {
|
||||
escaping = !escaping;
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
if (inBrace) {
|
||||
if (i === braceStart + 1) {
|
||||
if (c === '^' || c === '!') {
|
||||
braceNeg = true;
|
||||
}
|
||||
}
|
||||
else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
|
||||
inBrace = false;
|
||||
}
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
else if (c === '[') {
|
||||
inBrace = true;
|
||||
braceStart = i;
|
||||
braceNeg = false;
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
// we don't have to check for adoption here, because that's
|
||||
// done at the other recursion point.
|
||||
const doRecurse = !opt.noext &&
|
||||
isExtglobType(c) &&
|
||||
str.charAt(i) === '(' &&
|
||||
extDepth <= maxDepth;
|
||||
if (doRecurse) {
|
||||
ast.push(acc);
|
||||
acc = '';
|
||||
const ext = new _a(c, ast);
|
||||
i = _a.#parseAST(str, ext, i, opt, extDepth + 1);
|
||||
ast.push(ext);
|
||||
continue;
|
||||
}
|
||||
acc += c;
|
||||
}
|
||||
ast.push(acc);
|
||||
return i;
|
||||
}
|
||||
// some kind of extglob, pos is at the (
|
||||
// find the next | or )
|
||||
let i = pos + 1;
|
||||
let part = new _a(null, ast);
|
||||
const parts = [];
|
||||
let acc = '';
|
||||
while (i < str.length) {
|
||||
const c = str.charAt(i++);
|
||||
// still accumulate escapes at this point, but we do ignore
|
||||
// starts that are escaped
|
||||
if (escaping || c === '\\') {
|
||||
escaping = !escaping;
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
if (inBrace) {
|
||||
if (i === braceStart + 1) {
|
||||
if (c === '^' || c === '!') {
|
||||
braceNeg = true;
|
||||
}
|
||||
}
|
||||
else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
|
||||
inBrace = false;
|
||||
}
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
else if (c === '[') {
|
||||
inBrace = true;
|
||||
braceStart = i;
|
||||
braceNeg = false;
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
const doRecurse = !opt.noext &&
|
||||
isExtglobType(c) &&
|
||||
str.charAt(i) === '(' &&
|
||||
/* c8 ignore start - the maxDepth is sufficient here */
|
||||
(extDepth <= maxDepth || (ast && ast.#canAdoptType(c)));
|
||||
/* c8 ignore stop */
|
||||
if (doRecurse) {
|
||||
const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
|
||||
part.push(acc);
|
||||
acc = '';
|
||||
const ext = new _a(c, part);
|
||||
part.push(ext);
|
||||
i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);
|
||||
continue;
|
||||
}
|
||||
if (c === '|') {
|
||||
part.push(acc);
|
||||
acc = '';
|
||||
parts.push(part);
|
||||
part = new _a(null, ast);
|
||||
continue;
|
||||
}
|
||||
if (c === ')') {
|
||||
if (acc === '' && ast.#parts.length === 0) {
|
||||
ast.#emptyExt = true;
|
||||
}
|
||||
part.push(acc);
|
||||
acc = '';
|
||||
ast.push(...parts, part);
|
||||
return i;
|
||||
}
|
||||
acc += c;
|
||||
}
|
||||
// unfinished extglob
|
||||
// if we got here, it was a malformed extglob! not an extglob, but
|
||||
// maybe something else in there.
|
||||
ast.type = null;
|
||||
ast.#hasMagic = undefined;
|
||||
ast.#parts = [str.substring(pos - 1)];
|
||||
return i;
|
||||
}
|
||||
#canAdoptWithSpace(child) {
|
||||
return this.#canAdopt(child, adoptionWithSpaceMap);
|
||||
}
|
||||
#canAdopt(child, map = adoptionMap) {
|
||||
if (!child ||
|
||||
typeof child !== 'object' ||
|
||||
child.type !== null ||
|
||||
child.#parts.length !== 1 ||
|
||||
this.type === null) {
|
||||
return false;
|
||||
}
|
||||
const gc = child.#parts[0];
|
||||
if (!gc || typeof gc !== 'object' || gc.type === null) {
|
||||
return false;
|
||||
}
|
||||
return this.#canAdoptType(gc.type, map);
|
||||
}
|
||||
#canAdoptType(c, map = adoptionAnyMap) {
|
||||
return !!map.get(this.type)?.includes(c);
|
||||
}
|
||||
#adoptWithSpace(child, index) {
|
||||
const gc = child.#parts[0];
|
||||
const blank = new _a(null, gc, this.options);
|
||||
blank.#parts.push('');
|
||||
gc.push(blank);
|
||||
this.#adopt(child, index);
|
||||
}
|
||||
#adopt(child, index) {
|
||||
const gc = child.#parts[0];
|
||||
this.#parts.splice(index, 1, ...gc.#parts);
|
||||
for (const p of gc.#parts) {
|
||||
if (typeof p === 'object')
|
||||
p.#parent = this;
|
||||
}
|
||||
this.#toString = undefined;
|
||||
}
|
||||
#canUsurpType(c) {
|
||||
const m = usurpMap.get(this.type);
|
||||
return !!m?.has(c);
|
||||
}
|
||||
#canUsurp(child) {
|
||||
if (!child ||
|
||||
typeof child !== 'object' ||
|
||||
child.type !== null ||
|
||||
child.#parts.length !== 1 ||
|
||||
this.type === null ||
|
||||
this.#parts.length !== 1) {
|
||||
return false;
|
||||
}
|
||||
const gc = child.#parts[0];
|
||||
if (!gc || typeof gc !== 'object' || gc.type === null) {
|
||||
return false;
|
||||
}
|
||||
return this.#canUsurpType(gc.type);
|
||||
}
|
||||
#usurp(child) {
|
||||
const m = usurpMap.get(this.type);
|
||||
const gc = child.#parts[0];
|
||||
const nt = m?.get(gc.type);
|
||||
/* c8 ignore start - impossible */
|
||||
if (!nt)
|
||||
return false;
|
||||
/* c8 ignore stop */
|
||||
this.#parts = gc.#parts;
|
||||
for (const p of this.#parts) {
|
||||
if (typeof p === 'object') {
|
||||
p.#parent = this;
|
||||
}
|
||||
}
|
||||
this.type = nt;
|
||||
this.#toString = undefined;
|
||||
this.#emptyExt = false;
|
||||
}
|
||||
static fromGlob(pattern, options = {}) {
|
||||
const ast = new _a(null, undefined, options);
|
||||
_a.#parseAST(pattern, ast, 0, options, 0);
|
||||
return ast;
|
||||
}
|
||||
// returns the regular expression if there's magic, or the unescaped
|
||||
// string if not.
|
||||
toMMPattern() {
|
||||
// should only be called on root
|
||||
/* c8 ignore start */
|
||||
if (this !== this.#root)
|
||||
return this.#root.toMMPattern();
|
||||
/* c8 ignore stop */
|
||||
const glob = this.toString();
|
||||
const [re, body, hasMagic, uflag] = this.toRegExpSource();
|
||||
// if we're in nocase mode, and not nocaseMagicOnly, then we do
|
||||
// still need a regular expression if we have to case-insensitively
|
||||
// match capital/lowercase characters.
|
||||
const anyMagic = hasMagic ||
|
||||
this.#hasMagic ||
|
||||
(this.#options.nocase &&
|
||||
!this.#options.nocaseMagicOnly &&
|
||||
glob.toUpperCase() !== glob.toLowerCase());
|
||||
if (!anyMagic) {
|
||||
return body;
|
||||
}
|
||||
const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');
|
||||
return Object.assign(new RegExp(`^${re}$`, flags), {
|
||||
_src: re,
|
||||
_glob: glob,
|
||||
});
|
||||
}
|
||||
get options() {
|
||||
return this.#options;
|
||||
}
|
||||
// returns the string match, the regexp source, whether there's magic
|
||||
// in the regexp (so a regular expression is required) and whether or
|
||||
// not the uflag is needed for the regular expression (for posix classes)
|
||||
// TODO: instead of injecting the start/end at this point, just return
|
||||
// the BODY of the regexp, along with the start/end portions suitable
|
||||
// for binding the start/end in either a joined full-path makeRe context
|
||||
// (where we bind to (^|/), or a standalone matchPart context (where
|
||||
// we bind to ^, and not /). Otherwise slashes get duped!
|
||||
//
|
||||
// In part-matching mode, the start is:
|
||||
// - if not isStart: nothing
|
||||
// - if traversal possible, but not allowed: ^(?!\.\.?$)
|
||||
// - if dots allowed or not possible: ^
|
||||
// - if dots possible and not allowed: ^(?!\.)
|
||||
// end is:
|
||||
// - if not isEnd(): nothing
|
||||
// - else: $
|
||||
//
|
||||
// In full-path matching mode, we put the slash at the START of the
|
||||
// pattern, so start is:
|
||||
// - if first pattern: same as part-matching mode
|
||||
// - if not isStart(): nothing
|
||||
// - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
|
||||
// - if dots allowed or not possible: /
|
||||
// - if dots possible and not allowed: /(?!\.)
|
||||
// end is:
|
||||
// - if last pattern, same as part-matching mode
|
||||
// - else nothing
|
||||
//
|
||||
// Always put the (?:$|/) on negated tails, though, because that has to be
|
||||
// there to bind the end of the negated pattern portion, and it's easier to
|
||||
// just stick it in now rather than try to inject it later in the middle of
|
||||
// the pattern.
|
||||
//
|
||||
// We can just always return the same end, and leave it up to the caller
|
||||
// to know whether it's going to be used joined or in parts.
|
||||
// And, if the start is adjusted slightly, can do the same there:
|
||||
// - if not isStart: nothing
|
||||
// - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
|
||||
// - if dots allowed or not possible: (?:/|^)
|
||||
// - if dots possible and not allowed: (?:/|^)(?!\.)
|
||||
//
|
||||
// But it's better to have a simpler binding without a conditional, for
|
||||
// performance, so probably better to return both start options.
|
||||
//
|
||||
// Then the caller just ignores the end if it's not the first pattern,
|
||||
// and the start always gets applied.
|
||||
//
|
||||
// But that's always going to be $ if it's the ending pattern, or nothing,
|
||||
// so the caller can just attach $ at the end of the pattern when building.
|
||||
//
|
||||
// So the todo is:
|
||||
// - better detect what kind of start is needed
|
||||
// - return both flavors of starting pattern
|
||||
// - attach $ at the end of the pattern when creating the actual RegExp
|
||||
//
|
||||
// Ah, but wait, no, that all only applies to the root when the first pattern
|
||||
// is not an extglob. If the first pattern IS an extglob, then we need all
|
||||
// that dot prevention biz to live in the extglob portions, because eg
|
||||
// +(*|.x*) can match .xy but not .yx.
|
||||
//
|
||||
// So, return the two flavors if it's #root and the first child is not an
|
||||
// AST, otherwise leave it to the child AST to handle it, and there,
|
||||
// use the (?:^|/) style of start binding.
|
||||
//
|
||||
// Even simplified further:
|
||||
// - Since the start for a join is eg /(?!\.) and the start for a part
|
||||
// is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
|
||||
// or start or whatever) and prepend ^ or / at the Regexp construction.
|
||||
toRegExpSource(allowDot) {
|
||||
const dot = allowDot ?? !!this.#options.dot;
|
||||
if (this.#root === this) {
|
||||
this.#flatten();
|
||||
this.#fillNegs();
|
||||
}
|
||||
if (!isExtglobAST(this)) {
|
||||
const noEmpty = this.isStart() &&
|
||||
this.isEnd() &&
|
||||
!this.#parts.some(s => typeof s !== 'string');
|
||||
const src = this.#parts
|
||||
.map(p => {
|
||||
const [re, _, hasMagic, uflag] = typeof p === 'string' ?
|
||||
_a.#parseGlob(p, this.#hasMagic, noEmpty)
|
||||
: p.toRegExpSource(allowDot);
|
||||
this.#hasMagic = this.#hasMagic || hasMagic;
|
||||
this.#uflag = this.#uflag || uflag;
|
||||
return re;
|
||||
})
|
||||
.join('');
|
||||
let start = '';
|
||||
if (this.isStart()) {
|
||||
if (typeof this.#parts[0] === 'string') {
|
||||
// this is the string that will match the start of the pattern,
|
||||
// so we need to protect against dots and such.
|
||||
// '.' and '..' cannot match unless the pattern is that exactly,
|
||||
// even if it starts with . or dot:true is set.
|
||||
const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
|
||||
if (!dotTravAllowed) {
|
||||
const aps = addPatternStart;
|
||||
// check if we have a possibility of matching . or ..,
|
||||
// and prevent that.
|
||||
const needNoTrav =
|
||||
// dots are allowed, and the pattern starts with [ or .
|
||||
(dot && aps.has(src.charAt(0))) ||
|
||||
// the pattern starts with \., and then [ or .
|
||||
(src.startsWith('\\.') && aps.has(src.charAt(2))) ||
|
||||
// the pattern starts with \.\., and then [ or .
|
||||
(src.startsWith('\\.\\.') && aps.has(src.charAt(4)));
|
||||
// no need to prevent dots if it can't match a dot, or if a
|
||||
// sub-pattern will be preventing it anyway.
|
||||
const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
|
||||
start =
|
||||
needNoTrav ? startNoTraversal
|
||||
: needNoDot ? startNoDot
|
||||
: '';
|
||||
}
|
||||
}
|
||||
}
|
||||
// append the "end of path portion" pattern to negation tails
|
||||
let end = '';
|
||||
if (this.isEnd() &&
|
||||
this.#root.#filledNegs &&
|
||||
this.#parent?.type === '!') {
|
||||
end = '(?:$|\\/)';
|
||||
}
|
||||
const final = start + src + end;
|
||||
return [
|
||||
final,
|
||||
(0, unescape_js_1.unescape)(src),
|
||||
(this.#hasMagic = !!this.#hasMagic),
|
||||
this.#uflag,
|
||||
];
|
||||
}
|
||||
// We need to calculate the body *twice* if it's a repeat pattern
|
||||
// at the start, once in nodot mode, then again in dot mode, so a
|
||||
// pattern like *(?) can match 'x.y'
|
||||
const repeated = this.type === '*' || this.type === '+';
|
||||
// some kind of extglob
|
||||
const start = this.type === '!' ? '(?:(?!(?:' : '(?:';
|
||||
let body = this.#partsToRegExp(dot);
|
||||
if (this.isStart() && this.isEnd() && !body && this.type !== '!') {
|
||||
// invalid extglob, has to at least be *something* present, if it's
|
||||
// the entire path portion.
|
||||
const s = this.toString();
|
||||
const me = this;
|
||||
me.#parts = [s];
|
||||
me.type = null;
|
||||
me.#hasMagic = undefined;
|
||||
return [s, (0, unescape_js_1.unescape)(this.toString()), false, false];
|
||||
}
|
||||
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ?
|
||||
''
|
||||
: this.#partsToRegExp(true);
|
||||
if (bodyDotAllowed === body) {
|
||||
bodyDotAllowed = '';
|
||||
}
|
||||
if (bodyDotAllowed) {
|
||||
body = `(?:${body})(?:${bodyDotAllowed})*?`;
|
||||
}
|
||||
// an empty !() is exactly equivalent to a starNoEmpty
|
||||
let final = '';
|
||||
if (this.type === '!' && this.#emptyExt) {
|
||||
final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;
|
||||
}
|
||||
else {
|
||||
const close = this.type === '!' ?
|
||||
// !() must match something,but !(x) can match ''
|
||||
'))' +
|
||||
(this.isStart() && !dot && !allowDot ? startNoDot : '') +
|
||||
star +
|
||||
')'
|
||||
: this.type === '@' ? ')'
|
||||
: this.type === '?' ? ')?'
|
||||
: this.type === '+' && bodyDotAllowed ? ')'
|
||||
: this.type === '*' && bodyDotAllowed ? `)?`
|
||||
: `)${this.type}`;
|
||||
final = start + body + close;
|
||||
}
|
||||
return [
|
||||
final,
|
||||
(0, unescape_js_1.unescape)(body),
|
||||
(this.#hasMagic = !!this.#hasMagic),
|
||||
this.#uflag,
|
||||
];
|
||||
}
|
||||
#flatten() {
|
||||
if (!isExtglobAST(this)) {
|
||||
for (const p of this.#parts) {
|
||||
if (typeof p === 'object') {
|
||||
p.#flatten();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// do up to 10 passes to flatten as much as possible
|
||||
let iterations = 0;
|
||||
let done = false;
|
||||
do {
|
||||
done = true;
|
||||
for (let i = 0; i < this.#parts.length; i++) {
|
||||
const c = this.#parts[i];
|
||||
if (typeof c === 'object') {
|
||||
c.#flatten();
|
||||
if (this.#canAdopt(c)) {
|
||||
done = false;
|
||||
this.#adopt(c, i);
|
||||
}
|
||||
else if (this.#canAdoptWithSpace(c)) {
|
||||
done = false;
|
||||
this.#adoptWithSpace(c, i);
|
||||
}
|
||||
else if (this.#canUsurp(c)) {
|
||||
done = false;
|
||||
this.#usurp(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (!done && ++iterations < 10);
|
||||
}
|
||||
this.#toString = undefined;
|
||||
}
|
||||
#partsToRegExp(dot) {
|
||||
return this.#parts
|
||||
.map(p => {
|
||||
// extglob ASTs should only contain parent ASTs
|
||||
/* c8 ignore start */
|
||||
if (typeof p === 'string') {
|
||||
throw new Error('string type in extglob ast??');
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
// can ignore hasMagic, because extglobs are already always magic
|
||||
const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
|
||||
this.#uflag = this.#uflag || uflag;
|
||||
return re;
|
||||
})
|
||||
.filter(p => !(this.isStart() && this.isEnd()) || !!p)
|
||||
.join('|');
|
||||
}
|
||||
static #parseGlob(glob, hasMagic, noEmpty = false) {
|
||||
let escaping = false;
|
||||
let re = '';
|
||||
let uflag = false;
|
||||
// multiple stars that aren't globstars coalesce into one *
|
||||
let inStar = false;
|
||||
for (let i = 0; i < glob.length; i++) {
|
||||
const c = glob.charAt(i);
|
||||
if (escaping) {
|
||||
escaping = false;
|
||||
re += (reSpecials.has(c) ? '\\' : '') + c;
|
||||
continue;
|
||||
}
|
||||
if (c === '*') {
|
||||
if (inStar)
|
||||
continue;
|
||||
inStar = true;
|
||||
re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
|
||||
hasMagic = true;
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
inStar = false;
|
||||
}
|
||||
if (c === '\\') {
|
||||
if (i === glob.length - 1) {
|
||||
re += '\\\\';
|
||||
}
|
||||
else {
|
||||
escaping = true;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (c === '[') {
|
||||
const [src, needUflag, consumed, magic] = (0, brace_expressions_js_1.parseClass)(glob, i);
|
||||
if (consumed) {
|
||||
re += src;
|
||||
uflag = uflag || needUflag;
|
||||
i += consumed - 1;
|
||||
hasMagic = hasMagic || magic;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (c === '?') {
|
||||
re += qmark;
|
||||
hasMagic = true;
|
||||
continue;
|
||||
}
|
||||
re += regExpEscape(c);
|
||||
}
|
||||
return [re, (0, unescape_js_1.unescape)(glob), !!hasMagic, uflag];
|
||||
}
|
||||
}
|
||||
exports.AST = AST;
|
||||
_a = AST;
|
||||
//# sourceMappingURL=ast.js.map
|
||||
1
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/ast.js.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/ast.js.map
generated
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,8 +0,0 @@
|
|||
export type ParseClassResult = [
|
||||
src: string,
|
||||
uFlag: boolean,
|
||||
consumed: number,
|
||||
hasMagic: boolean
|
||||
];
|
||||
export declare const parseClass: (glob: string, position: number) => ParseClassResult;
|
||||
//# sourceMappingURL=brace-expressions.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"brace-expressions.d.ts","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":"AAgCA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,OAAO;CAClB,CAAA;AAQD,eAAO,MAAM,UAAU,GACrB,MAAM,MAAM,EACZ,UAAU,MAAM,KACf,gBA2HF,CAAA"}
|
||||
150
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/brace-expressions.js
generated
vendored
150
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/brace-expressions.js
generated
vendored
|
|
@ -1,150 +0,0 @@
|
|||
"use strict";
|
||||
// translate the various posix character classes into unicode properties
|
||||
// this works across all unicode locales
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.parseClass = void 0;
|
||||
// { <posix class>: [<translation>, /u flag required, negated]
|
||||
const posixClasses = {
|
||||
'[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true],
|
||||
'[:alpha:]': ['\\p{L}\\p{Nl}', true],
|
||||
'[:ascii:]': ['\\x' + '00-\\x' + '7f', false],
|
||||
'[:blank:]': ['\\p{Zs}\\t', true],
|
||||
'[:cntrl:]': ['\\p{Cc}', true],
|
||||
'[:digit:]': ['\\p{Nd}', true],
|
||||
'[:graph:]': ['\\p{Z}\\p{C}', true, true],
|
||||
'[:lower:]': ['\\p{Ll}', true],
|
||||
'[:print:]': ['\\p{C}', true],
|
||||
'[:punct:]': ['\\p{P}', true],
|
||||
'[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true],
|
||||
'[:upper:]': ['\\p{Lu}', true],
|
||||
'[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true],
|
||||
'[:xdigit:]': ['A-Fa-f0-9', false],
|
||||
};
|
||||
// only need to escape a few things inside of brace expressions
|
||||
// escapes: [ \ ] -
|
||||
const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&');
|
||||
// escape all regexp magic characters
|
||||
const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
||||
// everything has already been escaped, we just have to join
|
||||
const rangesToString = (ranges) => ranges.join('');
|
||||
// takes a glob string at a posix brace expression, and returns
|
||||
// an equivalent regular expression source, and boolean indicating
|
||||
// whether the /u flag needs to be applied, and the number of chars
|
||||
// consumed to parse the character class.
|
||||
// This also removes out of order ranges, and returns ($.) if the
|
||||
// entire class just no good.
|
||||
const parseClass = (glob, position) => {
|
||||
const pos = position;
|
||||
/* c8 ignore start */
|
||||
if (glob.charAt(pos) !== '[') {
|
||||
throw new Error('not in a brace expression');
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
const ranges = [];
|
||||
const negs = [];
|
||||
let i = pos + 1;
|
||||
let sawStart = false;
|
||||
let uflag = false;
|
||||
let escaping = false;
|
||||
let negate = false;
|
||||
let endPos = pos;
|
||||
let rangeStart = '';
|
||||
WHILE: while (i < glob.length) {
|
||||
const c = glob.charAt(i);
|
||||
if ((c === '!' || c === '^') && i === pos + 1) {
|
||||
negate = true;
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
if (c === ']' && sawStart && !escaping) {
|
||||
endPos = i + 1;
|
||||
break;
|
||||
}
|
||||
sawStart = true;
|
||||
if (c === '\\') {
|
||||
if (!escaping) {
|
||||
escaping = true;
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
// escaped \ char, fall through and treat like normal char
|
||||
}
|
||||
if (c === '[' && !escaping) {
|
||||
// either a posix class, a collation equivalent, or just a [
|
||||
for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
|
||||
if (glob.startsWith(cls, i)) {
|
||||
// invalid, [a-[] is fine, but not [a-[:alpha]]
|
||||
if (rangeStart) {
|
||||
return ['$.', false, glob.length - pos, true];
|
||||
}
|
||||
i += cls.length;
|
||||
if (neg)
|
||||
negs.push(unip);
|
||||
else
|
||||
ranges.push(unip);
|
||||
uflag = uflag || u;
|
||||
continue WHILE;
|
||||
}
|
||||
}
|
||||
}
|
||||
// now it's just a normal character, effectively
|
||||
escaping = false;
|
||||
if (rangeStart) {
|
||||
// throw this range away if it's not valid, but others
|
||||
// can still match.
|
||||
if (c > rangeStart) {
|
||||
ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c));
|
||||
}
|
||||
else if (c === rangeStart) {
|
||||
ranges.push(braceEscape(c));
|
||||
}
|
||||
rangeStart = '';
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
// now might be the start of a range.
|
||||
// can be either c-d or c-] or c<more...>] or c] at this point
|
||||
if (glob.startsWith('-]', i + 1)) {
|
||||
ranges.push(braceEscape(c + '-'));
|
||||
i += 2;
|
||||
continue;
|
||||
}
|
||||
if (glob.startsWith('-', i + 1)) {
|
||||
rangeStart = c;
|
||||
i += 2;
|
||||
continue;
|
||||
}
|
||||
// not the start of a range, just a single character
|
||||
ranges.push(braceEscape(c));
|
||||
i++;
|
||||
}
|
||||
if (endPos < i) {
|
||||
// didn't see the end of the class, not a valid class,
|
||||
// but might still be valid as a literal match.
|
||||
return ['', false, 0, false];
|
||||
}
|
||||
// if we got no ranges and no negates, then we have a range that
|
||||
// cannot possibly match anything, and that poisons the whole glob
|
||||
if (!ranges.length && !negs.length) {
|
||||
return ['$.', false, glob.length - pos, true];
|
||||
}
|
||||
// if we got one positive range, and it's a single character, then that's
|
||||
// not actually a magic pattern, it's just that one literal character.
|
||||
// we should not treat that as "magic", we should just return the literal
|
||||
// character. [_] is a perfectly valid way to escape glob magic chars.
|
||||
if (negs.length === 0 &&
|
||||
ranges.length === 1 &&
|
||||
/^\\?.$/.test(ranges[0]) &&
|
||||
!negate) {
|
||||
const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
|
||||
return [regexpEscape(r), false, endPos - pos, false];
|
||||
}
|
||||
const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';
|
||||
const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';
|
||||
const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'
|
||||
: ranges.length ? sranges
|
||||
: snegs;
|
||||
return [comb, uflag, endPos - pos, true];
|
||||
};
|
||||
exports.parseClass = parseClass;
|
||||
//# sourceMappingURL=brace-expressions.js.map
|
||||
File diff suppressed because one or more lines are too long
15
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/escape.d.ts
generated
vendored
15
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/escape.d.ts
generated
vendored
|
|
@ -1,15 +0,0 @@
|
|||
import type { MinimatchOptions } from './index.js';
|
||||
/**
|
||||
* Escape all magic characters in a glob pattern.
|
||||
*
|
||||
* If the {@link MinimatchOptions.windowsPathsNoEscape}
|
||||
* option is used, then characters are escaped by wrapping in `[]`, because
|
||||
* a magic character wrapped in a character class can only be satisfied by
|
||||
* that exact character. In this mode, `\` is _not_ escaped, because it is
|
||||
* not interpreted as a magic character, but instead as a path separator.
|
||||
*
|
||||
* If the {@link MinimatchOptions.magicalBraces} option is used,
|
||||
* then braces (`{` and `}`) will be escaped.
|
||||
*/
|
||||
export declare const escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
|
||||
//# sourceMappingURL=escape.d.ts.map
|
||||
1
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/escape.d.ts.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/escape.d.ts.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,MAAM,GACjB,GAAG,MAAM,EACT,2CAGG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,eAAe,CAAM,WAazE,CAAA"}
|
||||
30
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/escape.js
generated
vendored
30
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/escape.js
generated
vendored
|
|
@ -1,30 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.escape = void 0;
|
||||
/**
|
||||
* Escape all magic characters in a glob pattern.
|
||||
*
|
||||
* If the {@link MinimatchOptions.windowsPathsNoEscape}
|
||||
* option is used, then characters are escaped by wrapping in `[]`, because
|
||||
* a magic character wrapped in a character class can only be satisfied by
|
||||
* that exact character. In this mode, `\` is _not_ escaped, because it is
|
||||
* not interpreted as a magic character, but instead as a path separator.
|
||||
*
|
||||
* If the {@link MinimatchOptions.magicalBraces} option is used,
|
||||
* then braces (`{` and `}`) will be escaped.
|
||||
*/
|
||||
const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => {
|
||||
// don't need to escape +@! because we escape the parens
|
||||
// that make those magic, and escaping ! as [!] isn't valid,
|
||||
// because [!]] is a valid glob class meaning not ']'.
|
||||
if (magicalBraces) {
|
||||
return windowsPathsNoEscape ?
|
||||
s.replace(/[?*()[\]{}]/g, '[$&]')
|
||||
: s.replace(/[?*()[\]\\{}]/g, '\\$&');
|
||||
}
|
||||
return windowsPathsNoEscape ?
|
||||
s.replace(/[?*()[\]]/g, '[$&]')
|
||||
: s.replace(/[?*()[\]\\]/g, '\\$&');
|
||||
};
|
||||
exports.escape = escape;
|
||||
//# sourceMappingURL=escape.js.map
|
||||
1
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/escape.js.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/escape.js.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"escape.js","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;GAWG;AACI,MAAM,MAAM,GAAG,CACpB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,KAAK,MAC+C,EAAE,EACxE,EAAE;IACF,wDAAwD;IACxD,4DAA4D;IAC5D,sDAAsD;IACtD,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC;YACnC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;IACzC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC;QACjC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;AACvC,CAAC,CAAA;AAlBY,QAAA,MAAM,UAkBlB","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character. In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n *\n * If the {@link MinimatchOptions.magicalBraces} option is used,\n * then braces (`{` and `}`) will be escaped.\n */\nexport const escape = (\n s: string,\n {\n windowsPathsNoEscape = false,\n magicalBraces = false,\n }: Pick<MinimatchOptions, 'windowsPathsNoEscape' | 'magicalBraces'> = {},\n) => {\n // don't need to escape +@! because we escape the parens\n // that make those magic, and escaping ! as [!] isn't valid,\n // because [!]] is a valid glob class meaning not ']'.\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]{}]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\{}]/g, '\\\\$&')\n }\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&')\n}\n"]}
|
||||
174
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/index.d.ts
generated
vendored
174
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/index.d.ts
generated
vendored
|
|
@ -1,174 +0,0 @@
|
|||
import { AST } from './ast.js';
|
||||
export type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd';
|
||||
export interface MinimatchOptions {
|
||||
/** do not expand `{x,y}` style braces */
|
||||
nobrace?: boolean;
|
||||
/** do not treat patterns starting with `#` as a comment */
|
||||
nocomment?: boolean;
|
||||
/** do not treat patterns starting with `!` as a negation */
|
||||
nonegate?: boolean;
|
||||
/** print LOTS of debugging output */
|
||||
debug?: boolean;
|
||||
/** treat `**` the same as `*` */
|
||||
noglobstar?: boolean;
|
||||
/** do not expand extglobs like `+(a|b)` */
|
||||
noext?: boolean;
|
||||
/** return the pattern if nothing matches */
|
||||
nonull?: boolean;
|
||||
/** treat `\\` as a path separator, not an escape character */
|
||||
windowsPathsNoEscape?: boolean;
|
||||
/**
|
||||
* inverse of {@link MinimatchOptions.windowsPathsNoEscape}
|
||||
* @deprecated
|
||||
*/
|
||||
allowWindowsEscape?: boolean;
|
||||
/**
|
||||
* Compare a partial path to a pattern. As long as the parts
|
||||
* of the path that are present are not contradicted by the
|
||||
* pattern, it will be treated as a match. This is useful in
|
||||
* applications where you're walking through a folder structure,
|
||||
* and don't yet have the full path, but want to ensure that you
|
||||
* do not walk down paths that can never be a match.
|
||||
*/
|
||||
partial?: boolean;
|
||||
/** allow matches that start with `.` even if the pattern does not */
|
||||
dot?: boolean;
|
||||
/** ignore case */
|
||||
nocase?: boolean;
|
||||
/** ignore case only in wildcard patterns */
|
||||
nocaseMagicOnly?: boolean;
|
||||
/** consider braces to be "magic" for the purpose of `hasMagic` */
|
||||
magicalBraces?: boolean;
|
||||
/**
|
||||
* If set, then patterns without slashes will be matched
|
||||
* against the basename of the path if it contains slashes.
|
||||
* For example, `a?b` would match the path `/xyz/123/acb`, but
|
||||
* not `/xyz/acb/123`.
|
||||
*/
|
||||
matchBase?: boolean;
|
||||
/** invert the results of negated matches */
|
||||
flipNegate?: boolean;
|
||||
/** do not collapse multiple `/` into a single `/` */
|
||||
preserveMultipleSlashes?: boolean;
|
||||
/**
|
||||
* A number indicating the level of optimization that should be done
|
||||
* to the pattern prior to parsing and using it for matches.
|
||||
*/
|
||||
optimizationLevel?: number;
|
||||
/** operating system platform */
|
||||
platform?: Platform;
|
||||
/**
|
||||
* When a pattern starts with a UNC path or drive letter, and in
|
||||
* `nocase:true` mode, do not convert the root portions of the
|
||||
* pattern into a case-insensitive regular expression, and instead
|
||||
* leave them as strings.
|
||||
*
|
||||
* This is the default when the platform is `win32` and
|
||||
* `nocase:true` is set.
|
||||
*/
|
||||
windowsNoMagicRoot?: boolean;
|
||||
/**
|
||||
* max number of `{...}` patterns to expand. Default 100_000.
|
||||
*/
|
||||
braceExpandMax?: number;
|
||||
/**
|
||||
* Max number of non-adjacent `**` patterns to recursively walk down.
|
||||
*
|
||||
* The default of 200 is almost certainly high enough for most purposes,
|
||||
* and can handle absurdly excessive patterns.
|
||||
*/
|
||||
maxGlobstarRecursion?: number;
|
||||
/**
|
||||
* Max depth to traverse for nested extglobs like `*(a|b|c)`
|
||||
*
|
||||
* Default is 2, which is quite low, but any higher value
|
||||
* swiftly results in punishing performance impacts. Note
|
||||
* that this is *not* relevant when the globstar types can
|
||||
* be safely coalesced into a single set.
|
||||
*
|
||||
* For example, `*(a|@(b|c)|d)` would be flattened into
|
||||
* `*(a|b|c|d)`. Thus, many common extglobs will retain good
|
||||
* performance and never hit this limit, even if they are
|
||||
* excessively deep and complicated.
|
||||
*
|
||||
* If the limit is hit, then the extglob characters are simply
|
||||
* not parsed, and the pattern effectively switches into
|
||||
* `noextglob: true` mode for the contents of that nested
|
||||
* sub-pattern. This will typically _not_ result in a match,
|
||||
* but is considered a valid trade-off for security and
|
||||
* performance.
|
||||
*/
|
||||
maxExtglobRecursion?: number;
|
||||
}
|
||||
export declare const minimatch: {
|
||||
(p: string, pattern: string, options?: MinimatchOptions): boolean;
|
||||
sep: Sep;
|
||||
GLOBSTAR: typeof GLOBSTAR;
|
||||
filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
|
||||
defaults: (def: MinimatchOptions) => typeof minimatch;
|
||||
braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
|
||||
makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
|
||||
match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
|
||||
AST: typeof AST;
|
||||
Minimatch: typeof Minimatch;
|
||||
escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
|
||||
unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
|
||||
};
|
||||
export type Sep = '\\' | '/';
|
||||
export declare const sep: Sep;
|
||||
export declare const GLOBSTAR: unique symbol;
|
||||
export declare const filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
|
||||
export declare const defaults: (def: MinimatchOptions) => typeof minimatch;
|
||||
export declare const braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
|
||||
export declare const makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
|
||||
export declare const match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
|
||||
export type MMRegExp = RegExp & {
|
||||
_src?: string;
|
||||
_glob?: string;
|
||||
};
|
||||
export type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR;
|
||||
export type ParseReturn = ParseReturnFiltered | false;
|
||||
export declare class Minimatch {
|
||||
#private;
|
||||
options: MinimatchOptions;
|
||||
set: ParseReturnFiltered[][];
|
||||
pattern: string;
|
||||
windowsPathsNoEscape: boolean;
|
||||
nonegate: boolean;
|
||||
negate: boolean;
|
||||
comment: boolean;
|
||||
empty: boolean;
|
||||
preserveMultipleSlashes: boolean;
|
||||
partial: boolean;
|
||||
globSet: string[];
|
||||
globParts: string[][];
|
||||
nocase: boolean;
|
||||
isWindows: boolean;
|
||||
platform: Platform;
|
||||
windowsNoMagicRoot: boolean;
|
||||
maxGlobstarRecursion: number;
|
||||
regexp: false | null | MMRegExp;
|
||||
constructor(pattern: string, options?: MinimatchOptions);
|
||||
hasMagic(): boolean;
|
||||
debug(..._: unknown[]): void;
|
||||
make(): void;
|
||||
preprocess(globParts: string[][]): string[][];
|
||||
adjascentGlobstarOptimize(globParts: string[][]): string[][];
|
||||
levelOneOptimize(globParts: string[][]): string[][];
|
||||
levelTwoFileOptimize(parts: string | string[]): string[];
|
||||
firstPhasePreProcess(globParts: string[][]): string[][];
|
||||
secondPhasePreProcess(globParts: string[][]): string[][];
|
||||
partsMatch(a: string[], b: string[], emptyGSMatch?: boolean): false | string[];
|
||||
parseNegate(): void;
|
||||
matchOne(file: string[], pattern: ParseReturn[], partial?: boolean): boolean;
|
||||
braceExpand(): string[];
|
||||
parse(pattern: string): ParseReturn;
|
||||
makeRe(): false | MMRegExp;
|
||||
slashSplit(p: string): string[];
|
||||
match(f: string, partial?: boolean): boolean;
|
||||
static defaults(def: MinimatchOptions): typeof Minimatch;
|
||||
}
|
||||
export { AST } from './ast.js';
|
||||
export { escape } from './escape.js';
|
||||
export { unescape } from './unescape.js';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/index.d.ts.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/index.d.ts.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAI9B,MAAM,MAAM,QAAQ,GAChB,KAAK,GACL,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,OAAO,GACP,SAAS,GACT,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,CAAA;AAEZ,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qCAAqC;IACrC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,iCAAiC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,4CAA4C;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,8DAA8D;IAC9D,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,qEAAqE;IACrE,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,kBAAkB;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,4CAA4C;IAC5C,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,kEAAkE;IAClE,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,qDAAqD;IACrD,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,gCAAgC;IAChC,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB;;;;;;;;OAQG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAE7B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,eAAO,MAAM,SAAS;QACjB,MAAM,WACA,MAAM,YACN,gBAAgB;;;sBA4Gf,MAAM,YAAW,gBAAgB,MAC1C,GAAG,MAAM;oBAOkB,gBAAgB,KAAG,OAAO,SAAS;2BAuFtD,MAAM,YACN,gBAAgB;sBA2BK,MAAM,YAAW,gBAAgB;kBAKzD,MAAM,EAAE,WACL,MAAM,YACN,gBAAgB;;;;;CApO1B,CAAA;AAkED,MAAM,MAAM,GAAG,GAAG,IAAI,GAAG,GAAG,CAAA;AAQ5B,eAAO,MAAM,GAAG,KAC+C,CAAA;AAG/D,eAAO,MAAM,QAAQ,eAAwB,CAAA;AAmB7C,eAAO,MAAM,MAAM,GAChB,SAAS,MAAM,EAAE,UAAS,gBAAqB,MAC/C,GAAG,MAAM,YACsB,CAAA;AAMlC,eAAO,MAAM,QAAQ,GAAI,KAAK,gBAAgB,KAAG,OAAO,SAyEvD,CAAA;AAaD,eAAO,MAAM,WAAW,GACtB,SAAS,MAAM,EACf,UAAS,gBAAqB,aAY/B,CAAA;AAeD,eAAO,MAAM,MAAM,GAAI,SAAS,MAAM,EAAE,UAAS,gBAAqB,qBAC5B,CAAA;AAG1C,eAAO,MAAM,KAAK,GAChB,MAAM,MAAM,EAAE,EACd,SAAS,MAAM,EACf,UAAS,gBAAqB,aAQ/B,CAAA;AAQD,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,QAAQ,CAAA;AACrE,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG,KAAK,CAAA;AAErD,qBAAa,SAAS;;IACpB,OAAO,EAAE,gBAAgB,CAAA;IACzB,GAAG,EAAE,mBAAmB,EAAE,EAAE,CAAA;IAC5B,OAAO,EAAE,MAAM,CAAA;IAEf,oBAAoB,EAAE,OAAO,CAAA;IAC7B,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,OAAO,CAAA;IACd,uBAAuB,EAAE,OAAO,CAAA;IAChC,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,SAAS,EAAE,MAAM,EAAE,EAAE,CAAA;IACrB,MAAM,EAAE,OAAO,CAAA;IAEf,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,QAAQ,CAAA;IAClB,kBAAkB,EAAE,OAAO,CAAA;IAC3B,oBAAoB,EAAE,MAAM,CAAA;IAE5B,MAAM,EAAE,KAAK,GAAG,IAAI,GAAG,QAAQ,CAAA;gBACnB,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAqC3D,QAAQ,IAAI,OAAO;IAYnB,KAAK,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE;IAErB,IAAI;IA8FJ,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IA8BhC,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IAiB/C,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IAoBtC,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;IAoE7C,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IA0F1C,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE;IAkBxD,UAAU,CACR,CAAC,EAAE,MAAM,EAAE,EACX,CAAC,EAAE,MAAM,EAAE,EACX,YAAY,GAAE,OAAe,GAC5B,KAAK,GAAG,MAAM,EAAE;IA+CnB,WAAW;IAqBX,QAAQ,CACN,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE,WAAW,EAAE,EACtB,OAAO,GAAE,OAAe;IAiX1B,WAAW;IAIX,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW;IA6CnC,MAAM;IAuGN,UAAU,CAAC,CAAC,EAAE,MAAM;IAepB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,UAAe;IAgEvC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,gBAAgB;CAGtC;AAED,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}
|
||||
1127
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/index.js
generated
vendored
1127
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/index.js
generated
vendored
File diff suppressed because it is too large
Load diff
1
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/index.js.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
3
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/package.json
generated
vendored
3
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/package.json
generated
vendored
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"type": "commonjs"
|
||||
}
|
||||
22
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/unescape.d.ts
generated
vendored
22
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/unescape.d.ts
generated
vendored
|
|
@ -1,22 +0,0 @@
|
|||
import type { MinimatchOptions } from './index.js';
|
||||
/**
|
||||
* Un-escape a string that has been escaped with {@link escape}.
|
||||
*
|
||||
* If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
|
||||
* square-bracket escapes are removed, but not backslash escapes.
|
||||
*
|
||||
* For example, it will turn the string `'[*]'` into `*`, but it will not
|
||||
* turn `'\\*'` into `'*'`, because `\` is a path separator in
|
||||
* `windowsPathsNoEscape` mode.
|
||||
*
|
||||
* When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
|
||||
* backslash escapes are removed.
|
||||
*
|
||||
* Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
|
||||
* or unescaped.
|
||||
*
|
||||
* When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
|
||||
* unescaped.
|
||||
*/
|
||||
export declare const unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
|
||||
//# sourceMappingURL=unescape.d.ts.map
|
||||
1
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/unescape.d.ts.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/unescape.d.ts.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"unescape.d.ts","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,EACT,2CAGG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,eAAe,CAAM,WAczE,CAAA"}
|
||||
38
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/unescape.js
generated
vendored
38
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/unescape.js
generated
vendored
|
|
@ -1,38 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.unescape = void 0;
|
||||
/**
|
||||
* Un-escape a string that has been escaped with {@link escape}.
|
||||
*
|
||||
* If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
|
||||
* square-bracket escapes are removed, but not backslash escapes.
|
||||
*
|
||||
* For example, it will turn the string `'[*]'` into `*`, but it will not
|
||||
* turn `'\\*'` into `'*'`, because `\` is a path separator in
|
||||
* `windowsPathsNoEscape` mode.
|
||||
*
|
||||
* When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
|
||||
* backslash escapes are removed.
|
||||
*
|
||||
* Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
|
||||
* or unescaped.
|
||||
*
|
||||
* When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
|
||||
* unescaped.
|
||||
*/
|
||||
const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
|
||||
if (magicalBraces) {
|
||||
return windowsPathsNoEscape ?
|
||||
s.replace(/\[([^/\\])\]/g, '$1')
|
||||
: s
|
||||
.replace(/((?!\\).|^)\[([^/\\])\]/g, '$1$2')
|
||||
.replace(/\\([^/])/g, '$1');
|
||||
}
|
||||
return windowsPathsNoEscape ?
|
||||
s.replace(/\[([^/\\{}])\]/g, '$1')
|
||||
: s
|
||||
.replace(/((?!\\).|^)\[([^/\\{}])\]/g, '$1$2')
|
||||
.replace(/\\([^/{}])/g, '$1');
|
||||
};
|
||||
exports.unescape = unescape;
|
||||
//# sourceMappingURL=unescape.js.map
|
||||
1
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/unescape.js.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/minimatch/dist/commonjs/unescape.js.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"unescape.js","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;GAkBG;AAEI,MAAM,QAAQ,GAAG,CACtB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,IAAI,MACgD,EAAE,EACxE,EAAE;IACF,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC;YAClC,CAAC,CAAC,CAAC;iBACE,OAAO,CAAC,0BAA0B,EAAE,MAAM,CAAC;iBAC3C,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC;QACpC,CAAC,CAAC,CAAC;aACE,OAAO,CAAC,4BAA4B,EAAE,MAAM,CAAC;aAC7C,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,CAAA;AACrC,CAAC,CAAA;AAnBY,QAAA,QAAQ,YAmBpB","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then\n * square-bracket escapes are removed, but not backslash escapes.\n *\n * For example, it will turn the string `'[*]'` into `*`, but it will not\n * turn `'\\\\*'` into `'*'`, because `\\` is a path separator in\n * `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n *\n * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be\n * unescaped.\n */\n\nexport const unescape = (\n s: string,\n {\n windowsPathsNoEscape = false,\n magicalBraces = true,\n }: Pick<MinimatchOptions, 'windowsPathsNoEscape' | 'magicalBraces'> = {},\n) => {\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\])\\]/g, '$1$2')\n .replace(/\\\\([^/])/g, '$1')\n }\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\{}])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\{}])\\]/g, '$1$2')\n .replace(/\\\\([^/{}])/g, '$1')\n}\n"]}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
export declare const assertValidPattern: (pattern: unknown) => void;
|
||||
//# sourceMappingURL=assert-valid-pattern.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"assert-valid-pattern.d.ts","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAUtD,CAAA"}
|
||||
10
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/assert-valid-pattern.js
generated
vendored
10
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/assert-valid-pattern.js
generated
vendored
|
|
@ -1,10 +0,0 @@
|
|||
const MAX_PATTERN_LENGTH = 1024 * 64;
|
||||
export const assertValidPattern = (pattern) => {
|
||||
if (typeof pattern !== 'string') {
|
||||
throw new TypeError('invalid pattern');
|
||||
}
|
||||
if (pattern.length > MAX_PATTERN_LENGTH) {
|
||||
throw new TypeError('pattern is too long');
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=assert-valid-pattern.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"assert-valid-pattern.js","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAA;AACpC,MAAM,CAAC,MAAM,kBAAkB,GAA+B,CAC5D,OAAgB,EACW,EAAE;IAC7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAA;IACxC,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,kBAAkB,EAAE,CAAC;QACxC,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC,CAAA","sourcesContent":["const MAX_PATTERN_LENGTH = 1024 * 64\nexport const assertValidPattern: (pattern: unknown) => void = (\n pattern: unknown,\n): asserts pattern is string => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern')\n }\n\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long')\n }\n}\n"]}
|
||||
22
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/ast.d.ts
generated
vendored
22
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/ast.d.ts
generated
vendored
|
|
@ -1,22 +0,0 @@
|
|||
import type { MinimatchOptions, MMRegExp } from './index.js';
|
||||
export type ExtglobType = '!' | '?' | '+' | '*' | '@';
|
||||
export declare class AST {
|
||||
#private;
|
||||
type: ExtglobType | null;
|
||||
id: number;
|
||||
get depth(): number;
|
||||
constructor(type: ExtglobType | null, parent?: AST, options?: MinimatchOptions);
|
||||
get hasMagic(): boolean | undefined;
|
||||
toString(): string;
|
||||
push(...parts: (string | AST)[]): void;
|
||||
toJSON(): unknown[];
|
||||
isStart(): boolean;
|
||||
isEnd(): boolean;
|
||||
copyIn(part: AST | string): void;
|
||||
clone(parent: AST): AST;
|
||||
static fromGlob(pattern: string, options?: MinimatchOptions): AST;
|
||||
toMMPattern(): MMRegExp | string;
|
||||
get options(): MinimatchOptions;
|
||||
toRegExpSource(allowDot?: boolean): [re: string, body: string, hasMagic: boolean, uflag: boolean];
|
||||
}
|
||||
//# sourceMappingURL=ast.d.ts.map
|
||||
1
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/ast.d.ts.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/ast.d.ts.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAwC5D,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AAgJrD,qBAAa,GAAG;;IACd,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;IAexB,EAAE,SAAO;IAET,IAAI,KAAK,IAAI,MAAM,CAElB;gBAgBC,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,MAAM,CAAC,EAAE,GAAG,EACZ,OAAO,GAAE,gBAAqB;IAahC,IAAI,QAAQ,IAAI,OAAO,GAAG,SAAS,CAUlC;IAGD,QAAQ,IAAI,MAAM;IAkDlB,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE;IAe/B,MAAM;IAkBN,OAAO,IAAI,OAAO;IAgBlB,KAAK,IAAI,OAAO;IAYhB,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAKzB,KAAK,CAAC,MAAM,EAAE,GAAG;IAsQjB,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAQ/D,WAAW,IAAI,QAAQ,GAAG,MAAM;IA2BhC,IAAI,OAAO,qBAEV;IAuED,cAAc,CACZ,QAAQ,CAAC,EAAE,OAAO,GACjB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC;CA6OjE"}
|
||||
841
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/ast.js
generated
vendored
841
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/ast.js
generated
vendored
|
|
@ -1,841 +0,0 @@
|
|||
// parse a single path portion
|
||||
var _a;
|
||||
import { parseClass } from './brace-expressions.js';
|
||||
import { unescape } from './unescape.js';
|
||||
const types = new Set(['!', '?', '+', '*', '@']);
|
||||
const isExtglobType = (c) => types.has(c);
|
||||
const isExtglobAST = (c) => isExtglobType(c.type);
|
||||
// Map of which extglob types can adopt the children of a nested extglob
|
||||
//
|
||||
// anything but ! can adopt a matching type:
|
||||
// +(a|+(b|c)|d) => +(a|b|c|d)
|
||||
// *(a|*(b|c)|d) => *(a|b|c|d)
|
||||
// @(a|@(b|c)|d) => @(a|b|c|d)
|
||||
// ?(a|?(b|c)|d) => ?(a|b|c|d)
|
||||
//
|
||||
// * can adopt anything, because 0 or repetition is allowed
|
||||
// *(a|?(b|c)|d) => *(a|b|c|d)
|
||||
// *(a|+(b|c)|d) => *(a|b|c|d)
|
||||
// *(a|@(b|c)|d) => *(a|b|c|d)
|
||||
//
|
||||
// + can adopt @, because 1 or repetition is allowed
|
||||
// +(a|@(b|c)|d) => +(a|b|c|d)
|
||||
//
|
||||
// + and @ CANNOT adopt *, because 0 would be allowed
|
||||
// +(a|*(b|c)|d) => would match "", on *(b|c)
|
||||
// @(a|*(b|c)|d) => would match "", on *(b|c)
|
||||
//
|
||||
// + and @ CANNOT adopt ?, because 0 would be allowed
|
||||
// +(a|?(b|c)|d) => would match "", on ?(b|c)
|
||||
// @(a|?(b|c)|d) => would match "", on ?(b|c)
|
||||
//
|
||||
// ? can adopt @, because 0 or 1 is allowed
|
||||
// ?(a|@(b|c)|d) => ?(a|b|c|d)
|
||||
//
|
||||
// ? and @ CANNOT adopt * or +, because >1 would be allowed
|
||||
// ?(a|*(b|c)|d) => would match bbb on *(b|c)
|
||||
// @(a|*(b|c)|d) => would match bbb on *(b|c)
|
||||
// ?(a|+(b|c)|d) => would match bbb on +(b|c)
|
||||
// @(a|+(b|c)|d) => would match bbb on +(b|c)
|
||||
//
|
||||
// ! CANNOT adopt ! (nothing else can either)
|
||||
// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)
|
||||
//
|
||||
// ! can adopt @
|
||||
// !(a|@(b|c)|d) => !(a|b|c|d)
|
||||
//
|
||||
// ! CANNOT adopt *
|
||||
// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed
|
||||
//
|
||||
// ! CANNOT adopt +
|
||||
// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed
|
||||
//
|
||||
// ! CANNOT adopt ?
|
||||
// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match "x"
|
||||
const adoptionMap = new Map([
|
||||
['!', ['@']],
|
||||
['?', ['?', '@']],
|
||||
['@', ['@']],
|
||||
['*', ['*', '+', '?', '@']],
|
||||
['+', ['+', '@']],
|
||||
]);
|
||||
// nested extglobs that can be adopted in, but with the addition of
|
||||
// a blank '' element.
|
||||
const adoptionWithSpaceMap = new Map([
|
||||
['!', ['?']],
|
||||
['@', ['?']],
|
||||
['+', ['?', '*']],
|
||||
]);
|
||||
// union of the previous two maps
|
||||
const adoptionAnyMap = new Map([
|
||||
['!', ['?', '@']],
|
||||
['?', ['?', '@']],
|
||||
['@', ['?', '@']],
|
||||
['*', ['*', '+', '?', '@']],
|
||||
['+', ['+', '@', '?', '*']],
|
||||
]);
|
||||
// Extglobs that can take over their parent if they are the only child
|
||||
// the key is parent, value maps child to resulting extglob parent type
|
||||
// '@' is omitted because it's a special case. An `@` extglob with a single
|
||||
// member can always be usurped by that subpattern.
|
||||
const usurpMap = new Map([
|
||||
['!', new Map([['!', '@']])],
|
||||
[
|
||||
'?',
|
||||
new Map([
|
||||
['*', '*'],
|
||||
['+', '*'],
|
||||
]),
|
||||
],
|
||||
[
|
||||
'@',
|
||||
new Map([
|
||||
['!', '!'],
|
||||
['?', '?'],
|
||||
['@', '@'],
|
||||
['*', '*'],
|
||||
['+', '+'],
|
||||
]),
|
||||
],
|
||||
[
|
||||
'+',
|
||||
new Map([
|
||||
['?', '*'],
|
||||
['*', '*'],
|
||||
]),
|
||||
],
|
||||
]);
|
||||
// Patterns that get prepended to bind to the start of either the
|
||||
// entire string, or just a single path portion, to prevent dots
|
||||
// and/or traversal patterns, when needed.
|
||||
// Exts don't need the ^ or / bit, because the root binds that already.
|
||||
const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))';
|
||||
const startNoDot = '(?!\\.)';
|
||||
// characters that indicate a start of pattern needs the "no dots" bit,
|
||||
// because a dot *might* be matched. ( is not in the list, because in
|
||||
// the case of a child extglob, it will handle the prevention itself.
|
||||
const addPatternStart = new Set(['[', '.']);
|
||||
// cases where traversal is A-OK, no dot prevention needed
|
||||
const justDots = new Set(['..', '.']);
|
||||
const reSpecials = new Set('().*{}+?[]^$\\!');
|
||||
const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
||||
// any single thing other than /
|
||||
const qmark = '[^/]';
|
||||
// * => any number of characters
|
||||
const star = qmark + '*?';
|
||||
// use + when we need to ensure that *something* matches, because the * is
|
||||
// the only thing in the path portion.
|
||||
const starNoEmpty = qmark + '+?';
|
||||
// remove the \ chars that we added if we end up doing a nonmagic compare
|
||||
// const deslash = (s: string) => s.replace(/\\(.)/g, '$1')
|
||||
let ID = 0;
|
||||
export class AST {
|
||||
type;
|
||||
#root;
|
||||
#hasMagic;
|
||||
#uflag = false;
|
||||
#parts = [];
|
||||
#parent;
|
||||
#parentIndex;
|
||||
#negs;
|
||||
#filledNegs = false;
|
||||
#options;
|
||||
#toString;
|
||||
// set to true if it's an extglob with no children
|
||||
// (which really means one child of '')
|
||||
#emptyExt = false;
|
||||
id = ++ID;
|
||||
get depth() {
|
||||
return (this.#parent?.depth ?? -1) + 1;
|
||||
}
|
||||
[Symbol.for('nodejs.util.inspect.custom')]() {
|
||||
return {
|
||||
'@@type': 'AST',
|
||||
id: this.id,
|
||||
type: this.type,
|
||||
root: this.#root.id,
|
||||
parent: this.#parent?.id,
|
||||
depth: this.depth,
|
||||
partsLength: this.#parts.length,
|
||||
parts: this.#parts,
|
||||
};
|
||||
}
|
||||
constructor(type, parent, options = {}) {
|
||||
this.type = type;
|
||||
// extglobs are inherently magical
|
||||
if (type)
|
||||
this.#hasMagic = true;
|
||||
this.#parent = parent;
|
||||
this.#root = this.#parent ? this.#parent.#root : this;
|
||||
this.#options = this.#root === this ? options : this.#root.#options;
|
||||
this.#negs = this.#root === this ? [] : this.#root.#negs;
|
||||
if (type === '!' && !this.#root.#filledNegs)
|
||||
this.#negs.push(this);
|
||||
this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
|
||||
}
|
||||
get hasMagic() {
|
||||
/* c8 ignore start */
|
||||
if (this.#hasMagic !== undefined)
|
||||
return this.#hasMagic;
|
||||
/* c8 ignore stop */
|
||||
for (const p of this.#parts) {
|
||||
if (typeof p === 'string')
|
||||
continue;
|
||||
if (p.type || p.hasMagic)
|
||||
return (this.#hasMagic = true);
|
||||
}
|
||||
// note: will be undefined until we generate the regexp src and find out
|
||||
return this.#hasMagic;
|
||||
}
|
||||
// reconstructs the pattern
|
||||
toString() {
|
||||
return (this.#toString !== undefined ? this.#toString
|
||||
: !this.type ?
|
||||
(this.#toString = this.#parts.map(p => String(p)).join(''))
|
||||
: (this.#toString =
|
||||
this.type +
|
||||
'(' +
|
||||
this.#parts.map(p => String(p)).join('|') +
|
||||
')'));
|
||||
}
|
||||
#fillNegs() {
|
||||
/* c8 ignore start */
|
||||
if (this !== this.#root)
|
||||
throw new Error('should only call on root');
|
||||
if (this.#filledNegs)
|
||||
return this;
|
||||
/* c8 ignore stop */
|
||||
// call toString() once to fill this out
|
||||
this.toString();
|
||||
this.#filledNegs = true;
|
||||
let n;
|
||||
while ((n = this.#negs.pop())) {
|
||||
if (n.type !== '!')
|
||||
continue;
|
||||
// walk up the tree, appending everthing that comes AFTER parentIndex
|
||||
let p = n;
|
||||
let pp = p.#parent;
|
||||
while (pp) {
|
||||
for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {
|
||||
for (const part of n.#parts) {
|
||||
/* c8 ignore start */
|
||||
if (typeof part === 'string') {
|
||||
throw new Error('string part in extglob AST??');
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
part.copyIn(pp.#parts[i]);
|
||||
}
|
||||
}
|
||||
p = pp;
|
||||
pp = p.#parent;
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
push(...parts) {
|
||||
for (const p of parts) {
|
||||
if (p === '')
|
||||
continue;
|
||||
/* c8 ignore start */
|
||||
if (typeof p !== 'string' &&
|
||||
!(p instanceof _a && p.#parent === this)) {
|
||||
throw new Error('invalid part: ' + p);
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
this.#parts.push(p);
|
||||
}
|
||||
}
|
||||
toJSON() {
|
||||
const ret = this.type === null ?
|
||||
this.#parts
|
||||
.slice()
|
||||
.map(p => (typeof p === 'string' ? p : p.toJSON()))
|
||||
: [this.type, ...this.#parts.map(p => p.toJSON())];
|
||||
if (this.isStart() && !this.type)
|
||||
ret.unshift([]);
|
||||
if (this.isEnd() &&
|
||||
(this === this.#root ||
|
||||
(this.#root.#filledNegs && this.#parent?.type === '!'))) {
|
||||
ret.push({});
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
isStart() {
|
||||
if (this.#root === this)
|
||||
return true;
|
||||
// if (this.type) return !!this.#parent?.isStart()
|
||||
if (!this.#parent?.isStart())
|
||||
return false;
|
||||
if (this.#parentIndex === 0)
|
||||
return true;
|
||||
// if everything AHEAD of this is a negation, then it's still the "start"
|
||||
const p = this.#parent;
|
||||
for (let i = 0; i < this.#parentIndex; i++) {
|
||||
const pp = p.#parts[i];
|
||||
if (!(pp instanceof _a && pp.type === '!')) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
isEnd() {
|
||||
if (this.#root === this)
|
||||
return true;
|
||||
if (this.#parent?.type === '!')
|
||||
return true;
|
||||
if (!this.#parent?.isEnd())
|
||||
return false;
|
||||
if (!this.type)
|
||||
return this.#parent?.isEnd();
|
||||
// if not root, it'll always have a parent
|
||||
/* c8 ignore start */
|
||||
const pl = this.#parent ? this.#parent.#parts.length : 0;
|
||||
/* c8 ignore stop */
|
||||
return this.#parentIndex === pl - 1;
|
||||
}
|
||||
copyIn(part) {
|
||||
if (typeof part === 'string')
|
||||
this.push(part);
|
||||
else
|
||||
this.push(part.clone(this));
|
||||
}
|
||||
clone(parent) {
|
||||
const c = new _a(this.type, parent);
|
||||
for (const p of this.#parts) {
|
||||
c.copyIn(p);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
static #parseAST(str, ast, pos, opt, extDepth) {
|
||||
const maxDepth = opt.maxExtglobRecursion ?? 2;
|
||||
let escaping = false;
|
||||
let inBrace = false;
|
||||
let braceStart = -1;
|
||||
let braceNeg = false;
|
||||
if (ast.type === null) {
|
||||
// outside of a extglob, append until we find a start
|
||||
let i = pos;
|
||||
let acc = '';
|
||||
while (i < str.length) {
|
||||
const c = str.charAt(i++);
|
||||
// still accumulate escapes at this point, but we do ignore
|
||||
// starts that are escaped
|
||||
if (escaping || c === '\\') {
|
||||
escaping = !escaping;
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
if (inBrace) {
|
||||
if (i === braceStart + 1) {
|
||||
if (c === '^' || c === '!') {
|
||||
braceNeg = true;
|
||||
}
|
||||
}
|
||||
else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
|
||||
inBrace = false;
|
||||
}
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
else if (c === '[') {
|
||||
inBrace = true;
|
||||
braceStart = i;
|
||||
braceNeg = false;
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
// we don't have to check for adoption here, because that's
|
||||
// done at the other recursion point.
|
||||
const doRecurse = !opt.noext &&
|
||||
isExtglobType(c) &&
|
||||
str.charAt(i) === '(' &&
|
||||
extDepth <= maxDepth;
|
||||
if (doRecurse) {
|
||||
ast.push(acc);
|
||||
acc = '';
|
||||
const ext = new _a(c, ast);
|
||||
i = _a.#parseAST(str, ext, i, opt, extDepth + 1);
|
||||
ast.push(ext);
|
||||
continue;
|
||||
}
|
||||
acc += c;
|
||||
}
|
||||
ast.push(acc);
|
||||
return i;
|
||||
}
|
||||
// some kind of extglob, pos is at the (
|
||||
// find the next | or )
|
||||
let i = pos + 1;
|
||||
let part = new _a(null, ast);
|
||||
const parts = [];
|
||||
let acc = '';
|
||||
while (i < str.length) {
|
||||
const c = str.charAt(i++);
|
||||
// still accumulate escapes at this point, but we do ignore
|
||||
// starts that are escaped
|
||||
if (escaping || c === '\\') {
|
||||
escaping = !escaping;
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
if (inBrace) {
|
||||
if (i === braceStart + 1) {
|
||||
if (c === '^' || c === '!') {
|
||||
braceNeg = true;
|
||||
}
|
||||
}
|
||||
else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
|
||||
inBrace = false;
|
||||
}
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
else if (c === '[') {
|
||||
inBrace = true;
|
||||
braceStart = i;
|
||||
braceNeg = false;
|
||||
acc += c;
|
||||
continue;
|
||||
}
|
||||
const doRecurse = !opt.noext &&
|
||||
isExtglobType(c) &&
|
||||
str.charAt(i) === '(' &&
|
||||
/* c8 ignore start - the maxDepth is sufficient here */
|
||||
(extDepth <= maxDepth || (ast && ast.#canAdoptType(c)));
|
||||
/* c8 ignore stop */
|
||||
if (doRecurse) {
|
||||
const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
|
||||
part.push(acc);
|
||||
acc = '';
|
||||
const ext = new _a(c, part);
|
||||
part.push(ext);
|
||||
i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);
|
||||
continue;
|
||||
}
|
||||
if (c === '|') {
|
||||
part.push(acc);
|
||||
acc = '';
|
||||
parts.push(part);
|
||||
part = new _a(null, ast);
|
||||
continue;
|
||||
}
|
||||
if (c === ')') {
|
||||
if (acc === '' && ast.#parts.length === 0) {
|
||||
ast.#emptyExt = true;
|
||||
}
|
||||
part.push(acc);
|
||||
acc = '';
|
||||
ast.push(...parts, part);
|
||||
return i;
|
||||
}
|
||||
acc += c;
|
||||
}
|
||||
// unfinished extglob
|
||||
// if we got here, it was a malformed extglob! not an extglob, but
|
||||
// maybe something else in there.
|
||||
ast.type = null;
|
||||
ast.#hasMagic = undefined;
|
||||
ast.#parts = [str.substring(pos - 1)];
|
||||
return i;
|
||||
}
|
||||
#canAdoptWithSpace(child) {
|
||||
return this.#canAdopt(child, adoptionWithSpaceMap);
|
||||
}
|
||||
#canAdopt(child, map = adoptionMap) {
|
||||
if (!child ||
|
||||
typeof child !== 'object' ||
|
||||
child.type !== null ||
|
||||
child.#parts.length !== 1 ||
|
||||
this.type === null) {
|
||||
return false;
|
||||
}
|
||||
const gc = child.#parts[0];
|
||||
if (!gc || typeof gc !== 'object' || gc.type === null) {
|
||||
return false;
|
||||
}
|
||||
return this.#canAdoptType(gc.type, map);
|
||||
}
|
||||
#canAdoptType(c, map = adoptionAnyMap) {
|
||||
return !!map.get(this.type)?.includes(c);
|
||||
}
|
||||
#adoptWithSpace(child, index) {
|
||||
const gc = child.#parts[0];
|
||||
const blank = new _a(null, gc, this.options);
|
||||
blank.#parts.push('');
|
||||
gc.push(blank);
|
||||
this.#adopt(child, index);
|
||||
}
|
||||
#adopt(child, index) {
|
||||
const gc = child.#parts[0];
|
||||
this.#parts.splice(index, 1, ...gc.#parts);
|
||||
for (const p of gc.#parts) {
|
||||
if (typeof p === 'object')
|
||||
p.#parent = this;
|
||||
}
|
||||
this.#toString = undefined;
|
||||
}
|
||||
#canUsurpType(c) {
|
||||
const m = usurpMap.get(this.type);
|
||||
return !!m?.has(c);
|
||||
}
|
||||
#canUsurp(child) {
|
||||
if (!child ||
|
||||
typeof child !== 'object' ||
|
||||
child.type !== null ||
|
||||
child.#parts.length !== 1 ||
|
||||
this.type === null ||
|
||||
this.#parts.length !== 1) {
|
||||
return false;
|
||||
}
|
||||
const gc = child.#parts[0];
|
||||
if (!gc || typeof gc !== 'object' || gc.type === null) {
|
||||
return false;
|
||||
}
|
||||
return this.#canUsurpType(gc.type);
|
||||
}
|
||||
#usurp(child) {
|
||||
const m = usurpMap.get(this.type);
|
||||
const gc = child.#parts[0];
|
||||
const nt = m?.get(gc.type);
|
||||
/* c8 ignore start - impossible */
|
||||
if (!nt)
|
||||
return false;
|
||||
/* c8 ignore stop */
|
||||
this.#parts = gc.#parts;
|
||||
for (const p of this.#parts) {
|
||||
if (typeof p === 'object') {
|
||||
p.#parent = this;
|
||||
}
|
||||
}
|
||||
this.type = nt;
|
||||
this.#toString = undefined;
|
||||
this.#emptyExt = false;
|
||||
}
|
||||
static fromGlob(pattern, options = {}) {
|
||||
const ast = new _a(null, undefined, options);
|
||||
_a.#parseAST(pattern, ast, 0, options, 0);
|
||||
return ast;
|
||||
}
|
||||
// returns the regular expression if there's magic, or the unescaped
|
||||
// string if not.
|
||||
toMMPattern() {
|
||||
// should only be called on root
|
||||
/* c8 ignore start */
|
||||
if (this !== this.#root)
|
||||
return this.#root.toMMPattern();
|
||||
/* c8 ignore stop */
|
||||
const glob = this.toString();
|
||||
const [re, body, hasMagic, uflag] = this.toRegExpSource();
|
||||
// if we're in nocase mode, and not nocaseMagicOnly, then we do
|
||||
// still need a regular expression if we have to case-insensitively
|
||||
// match capital/lowercase characters.
|
||||
const anyMagic = hasMagic ||
|
||||
this.#hasMagic ||
|
||||
(this.#options.nocase &&
|
||||
!this.#options.nocaseMagicOnly &&
|
||||
glob.toUpperCase() !== glob.toLowerCase());
|
||||
if (!anyMagic) {
|
||||
return body;
|
||||
}
|
||||
const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');
|
||||
return Object.assign(new RegExp(`^${re}$`, flags), {
|
||||
_src: re,
|
||||
_glob: glob,
|
||||
});
|
||||
}
|
||||
get options() {
|
||||
return this.#options;
|
||||
}
|
||||
// returns the string match, the regexp source, whether there's magic
|
||||
// in the regexp (so a regular expression is required) and whether or
|
||||
// not the uflag is needed for the regular expression (for posix classes)
|
||||
// TODO: instead of injecting the start/end at this point, just return
|
||||
// the BODY of the regexp, along with the start/end portions suitable
|
||||
// for binding the start/end in either a joined full-path makeRe context
|
||||
// (where we bind to (^|/), or a standalone matchPart context (where
|
||||
// we bind to ^, and not /). Otherwise slashes get duped!
|
||||
//
|
||||
// In part-matching mode, the start is:
|
||||
// - if not isStart: nothing
|
||||
// - if traversal possible, but not allowed: ^(?!\.\.?$)
|
||||
// - if dots allowed or not possible: ^
|
||||
// - if dots possible and not allowed: ^(?!\.)
|
||||
// end is:
|
||||
// - if not isEnd(): nothing
|
||||
// - else: $
|
||||
//
|
||||
// In full-path matching mode, we put the slash at the START of the
|
||||
// pattern, so start is:
|
||||
// - if first pattern: same as part-matching mode
|
||||
// - if not isStart(): nothing
|
||||
// - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
|
||||
// - if dots allowed or not possible: /
|
||||
// - if dots possible and not allowed: /(?!\.)
|
||||
// end is:
|
||||
// - if last pattern, same as part-matching mode
|
||||
// - else nothing
|
||||
//
|
||||
// Always put the (?:$|/) on negated tails, though, because that has to be
|
||||
// there to bind the end of the negated pattern portion, and it's easier to
|
||||
// just stick it in now rather than try to inject it later in the middle of
|
||||
// the pattern.
|
||||
//
|
||||
// We can just always return the same end, and leave it up to the caller
|
||||
// to know whether it's going to be used joined or in parts.
|
||||
// And, if the start is adjusted slightly, can do the same there:
|
||||
// - if not isStart: nothing
|
||||
// - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
|
||||
// - if dots allowed or not possible: (?:/|^)
|
||||
// - if dots possible and not allowed: (?:/|^)(?!\.)
|
||||
//
|
||||
// But it's better to have a simpler binding without a conditional, for
|
||||
// performance, so probably better to return both start options.
|
||||
//
|
||||
// Then the caller just ignores the end if it's not the first pattern,
|
||||
// and the start always gets applied.
|
||||
//
|
||||
// But that's always going to be $ if it's the ending pattern, or nothing,
|
||||
// so the caller can just attach $ at the end of the pattern when building.
|
||||
//
|
||||
// So the todo is:
|
||||
// - better detect what kind of start is needed
|
||||
// - return both flavors of starting pattern
|
||||
// - attach $ at the end of the pattern when creating the actual RegExp
|
||||
//
|
||||
// Ah, but wait, no, that all only applies to the root when the first pattern
|
||||
// is not an extglob. If the first pattern IS an extglob, then we need all
|
||||
// that dot prevention biz to live in the extglob portions, because eg
|
||||
// +(*|.x*) can match .xy but not .yx.
|
||||
//
|
||||
// So, return the two flavors if it's #root and the first child is not an
|
||||
// AST, otherwise leave it to the child AST to handle it, and there,
|
||||
// use the (?:^|/) style of start binding.
|
||||
//
|
||||
// Even simplified further:
|
||||
// - Since the start for a join is eg /(?!\.) and the start for a part
|
||||
// is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
|
||||
// or start or whatever) and prepend ^ or / at the Regexp construction.
|
||||
toRegExpSource(allowDot) {
|
||||
const dot = allowDot ?? !!this.#options.dot;
|
||||
if (this.#root === this) {
|
||||
this.#flatten();
|
||||
this.#fillNegs();
|
||||
}
|
||||
if (!isExtglobAST(this)) {
|
||||
const noEmpty = this.isStart() &&
|
||||
this.isEnd() &&
|
||||
!this.#parts.some(s => typeof s !== 'string');
|
||||
const src = this.#parts
|
||||
.map(p => {
|
||||
const [re, _, hasMagic, uflag] = typeof p === 'string' ?
|
||||
_a.#parseGlob(p, this.#hasMagic, noEmpty)
|
||||
: p.toRegExpSource(allowDot);
|
||||
this.#hasMagic = this.#hasMagic || hasMagic;
|
||||
this.#uflag = this.#uflag || uflag;
|
||||
return re;
|
||||
})
|
||||
.join('');
|
||||
let start = '';
|
||||
if (this.isStart()) {
|
||||
if (typeof this.#parts[0] === 'string') {
|
||||
// this is the string that will match the start of the pattern,
|
||||
// so we need to protect against dots and such.
|
||||
// '.' and '..' cannot match unless the pattern is that exactly,
|
||||
// even if it starts with . or dot:true is set.
|
||||
const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
|
||||
if (!dotTravAllowed) {
|
||||
const aps = addPatternStart;
|
||||
// check if we have a possibility of matching . or ..,
|
||||
// and prevent that.
|
||||
const needNoTrav =
|
||||
// dots are allowed, and the pattern starts with [ or .
|
||||
(dot && aps.has(src.charAt(0))) ||
|
||||
// the pattern starts with \., and then [ or .
|
||||
(src.startsWith('\\.') && aps.has(src.charAt(2))) ||
|
||||
// the pattern starts with \.\., and then [ or .
|
||||
(src.startsWith('\\.\\.') && aps.has(src.charAt(4)));
|
||||
// no need to prevent dots if it can't match a dot, or if a
|
||||
// sub-pattern will be preventing it anyway.
|
||||
const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
|
||||
start =
|
||||
needNoTrav ? startNoTraversal
|
||||
: needNoDot ? startNoDot
|
||||
: '';
|
||||
}
|
||||
}
|
||||
}
|
||||
// append the "end of path portion" pattern to negation tails
|
||||
let end = '';
|
||||
if (this.isEnd() &&
|
||||
this.#root.#filledNegs &&
|
||||
this.#parent?.type === '!') {
|
||||
end = '(?:$|\\/)';
|
||||
}
|
||||
const final = start + src + end;
|
||||
return [
|
||||
final,
|
||||
unescape(src),
|
||||
(this.#hasMagic = !!this.#hasMagic),
|
||||
this.#uflag,
|
||||
];
|
||||
}
|
||||
// We need to calculate the body *twice* if it's a repeat pattern
|
||||
// at the start, once in nodot mode, then again in dot mode, so a
|
||||
// pattern like *(?) can match 'x.y'
|
||||
const repeated = this.type === '*' || this.type === '+';
|
||||
// some kind of extglob
|
||||
const start = this.type === '!' ? '(?:(?!(?:' : '(?:';
|
||||
let body = this.#partsToRegExp(dot);
|
||||
if (this.isStart() && this.isEnd() && !body && this.type !== '!') {
|
||||
// invalid extglob, has to at least be *something* present, if it's
|
||||
// the entire path portion.
|
||||
const s = this.toString();
|
||||
const me = this;
|
||||
me.#parts = [s];
|
||||
me.type = null;
|
||||
me.#hasMagic = undefined;
|
||||
return [s, unescape(this.toString()), false, false];
|
||||
}
|
||||
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ?
|
||||
''
|
||||
: this.#partsToRegExp(true);
|
||||
if (bodyDotAllowed === body) {
|
||||
bodyDotAllowed = '';
|
||||
}
|
||||
if (bodyDotAllowed) {
|
||||
body = `(?:${body})(?:${bodyDotAllowed})*?`;
|
||||
}
|
||||
// an empty !() is exactly equivalent to a starNoEmpty
|
||||
let final = '';
|
||||
if (this.type === '!' && this.#emptyExt) {
|
||||
final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;
|
||||
}
|
||||
else {
|
||||
const close = this.type === '!' ?
|
||||
// !() must match something,but !(x) can match ''
|
||||
'))' +
|
||||
(this.isStart() && !dot && !allowDot ? startNoDot : '') +
|
||||
star +
|
||||
')'
|
||||
: this.type === '@' ? ')'
|
||||
: this.type === '?' ? ')?'
|
||||
: this.type === '+' && bodyDotAllowed ? ')'
|
||||
: this.type === '*' && bodyDotAllowed ? `)?`
|
||||
: `)${this.type}`;
|
||||
final = start + body + close;
|
||||
}
|
||||
return [
|
||||
final,
|
||||
unescape(body),
|
||||
(this.#hasMagic = !!this.#hasMagic),
|
||||
this.#uflag,
|
||||
];
|
||||
}
|
||||
#flatten() {
|
||||
if (!isExtglobAST(this)) {
|
||||
for (const p of this.#parts) {
|
||||
if (typeof p === 'object') {
|
||||
p.#flatten();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// do up to 10 passes to flatten as much as possible
|
||||
let iterations = 0;
|
||||
let done = false;
|
||||
do {
|
||||
done = true;
|
||||
for (let i = 0; i < this.#parts.length; i++) {
|
||||
const c = this.#parts[i];
|
||||
if (typeof c === 'object') {
|
||||
c.#flatten();
|
||||
if (this.#canAdopt(c)) {
|
||||
done = false;
|
||||
this.#adopt(c, i);
|
||||
}
|
||||
else if (this.#canAdoptWithSpace(c)) {
|
||||
done = false;
|
||||
this.#adoptWithSpace(c, i);
|
||||
}
|
||||
else if (this.#canUsurp(c)) {
|
||||
done = false;
|
||||
this.#usurp(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (!done && ++iterations < 10);
|
||||
}
|
||||
this.#toString = undefined;
|
||||
}
|
||||
#partsToRegExp(dot) {
|
||||
return this.#parts
|
||||
.map(p => {
|
||||
// extglob ASTs should only contain parent ASTs
|
||||
/* c8 ignore start */
|
||||
if (typeof p === 'string') {
|
||||
throw new Error('string type in extglob ast??');
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
// can ignore hasMagic, because extglobs are already always magic
|
||||
const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
|
||||
this.#uflag = this.#uflag || uflag;
|
||||
return re;
|
||||
})
|
||||
.filter(p => !(this.isStart() && this.isEnd()) || !!p)
|
||||
.join('|');
|
||||
}
|
||||
static #parseGlob(glob, hasMagic, noEmpty = false) {
|
||||
let escaping = false;
|
||||
let re = '';
|
||||
let uflag = false;
|
||||
// multiple stars that aren't globstars coalesce into one *
|
||||
let inStar = false;
|
||||
for (let i = 0; i < glob.length; i++) {
|
||||
const c = glob.charAt(i);
|
||||
if (escaping) {
|
||||
escaping = false;
|
||||
re += (reSpecials.has(c) ? '\\' : '') + c;
|
||||
continue;
|
||||
}
|
||||
if (c === '*') {
|
||||
if (inStar)
|
||||
continue;
|
||||
inStar = true;
|
||||
re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
|
||||
hasMagic = true;
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
inStar = false;
|
||||
}
|
||||
if (c === '\\') {
|
||||
if (i === glob.length - 1) {
|
||||
re += '\\\\';
|
||||
}
|
||||
else {
|
||||
escaping = true;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (c === '[') {
|
||||
const [src, needUflag, consumed, magic] = parseClass(glob, i);
|
||||
if (consumed) {
|
||||
re += src;
|
||||
uflag = uflag || needUflag;
|
||||
i += consumed - 1;
|
||||
hasMagic = hasMagic || magic;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (c === '?') {
|
||||
re += qmark;
|
||||
hasMagic = true;
|
||||
continue;
|
||||
}
|
||||
re += regExpEscape(c);
|
||||
}
|
||||
return [re, unescape(glob), !!hasMagic, uflag];
|
||||
}
|
||||
}
|
||||
_a = AST;
|
||||
//# sourceMappingURL=ast.js.map
|
||||
1
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/ast.js.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/ast.js.map
generated
vendored
File diff suppressed because one or more lines are too long
8
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/brace-expressions.d.ts
generated
vendored
8
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/brace-expressions.d.ts
generated
vendored
|
|
@ -1,8 +0,0 @@
|
|||
export type ParseClassResult = [
|
||||
src: string,
|
||||
uFlag: boolean,
|
||||
consumed: number,
|
||||
hasMagic: boolean
|
||||
];
|
||||
export declare const parseClass: (glob: string, position: number) => ParseClassResult;
|
||||
//# sourceMappingURL=brace-expressions.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"brace-expressions.d.ts","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":"AAgCA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,OAAO;CAClB,CAAA;AAQD,eAAO,MAAM,UAAU,GACrB,MAAM,MAAM,EACZ,UAAU,MAAM,KACf,gBA2HF,CAAA"}
|
||||
146
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/brace-expressions.js
generated
vendored
146
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/brace-expressions.js
generated
vendored
|
|
@ -1,146 +0,0 @@
|
|||
// translate the various posix character classes into unicode properties
|
||||
// this works across all unicode locales
|
||||
// { <posix class>: [<translation>, /u flag required, negated]
|
||||
const posixClasses = {
|
||||
'[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true],
|
||||
'[:alpha:]': ['\\p{L}\\p{Nl}', true],
|
||||
'[:ascii:]': ['\\x' + '00-\\x' + '7f', false],
|
||||
'[:blank:]': ['\\p{Zs}\\t', true],
|
||||
'[:cntrl:]': ['\\p{Cc}', true],
|
||||
'[:digit:]': ['\\p{Nd}', true],
|
||||
'[:graph:]': ['\\p{Z}\\p{C}', true, true],
|
||||
'[:lower:]': ['\\p{Ll}', true],
|
||||
'[:print:]': ['\\p{C}', true],
|
||||
'[:punct:]': ['\\p{P}', true],
|
||||
'[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true],
|
||||
'[:upper:]': ['\\p{Lu}', true],
|
||||
'[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true],
|
||||
'[:xdigit:]': ['A-Fa-f0-9', false],
|
||||
};
|
||||
// only need to escape a few things inside of brace expressions
|
||||
// escapes: [ \ ] -
|
||||
const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&');
|
||||
// escape all regexp magic characters
|
||||
const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
||||
// everything has already been escaped, we just have to join
|
||||
const rangesToString = (ranges) => ranges.join('');
|
||||
// takes a glob string at a posix brace expression, and returns
|
||||
// an equivalent regular expression source, and boolean indicating
|
||||
// whether the /u flag needs to be applied, and the number of chars
|
||||
// consumed to parse the character class.
|
||||
// This also removes out of order ranges, and returns ($.) if the
|
||||
// entire class just no good.
|
||||
export const parseClass = (glob, position) => {
|
||||
const pos = position;
|
||||
/* c8 ignore start */
|
||||
if (glob.charAt(pos) !== '[') {
|
||||
throw new Error('not in a brace expression');
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
const ranges = [];
|
||||
const negs = [];
|
||||
let i = pos + 1;
|
||||
let sawStart = false;
|
||||
let uflag = false;
|
||||
let escaping = false;
|
||||
let negate = false;
|
||||
let endPos = pos;
|
||||
let rangeStart = '';
|
||||
WHILE: while (i < glob.length) {
|
||||
const c = glob.charAt(i);
|
||||
if ((c === '!' || c === '^') && i === pos + 1) {
|
||||
negate = true;
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
if (c === ']' && sawStart && !escaping) {
|
||||
endPos = i + 1;
|
||||
break;
|
||||
}
|
||||
sawStart = true;
|
||||
if (c === '\\') {
|
||||
if (!escaping) {
|
||||
escaping = true;
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
// escaped \ char, fall through and treat like normal char
|
||||
}
|
||||
if (c === '[' && !escaping) {
|
||||
// either a posix class, a collation equivalent, or just a [
|
||||
for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
|
||||
if (glob.startsWith(cls, i)) {
|
||||
// invalid, [a-[] is fine, but not [a-[:alpha]]
|
||||
if (rangeStart) {
|
||||
return ['$.', false, glob.length - pos, true];
|
||||
}
|
||||
i += cls.length;
|
||||
if (neg)
|
||||
negs.push(unip);
|
||||
else
|
||||
ranges.push(unip);
|
||||
uflag = uflag || u;
|
||||
continue WHILE;
|
||||
}
|
||||
}
|
||||
}
|
||||
// now it's just a normal character, effectively
|
||||
escaping = false;
|
||||
if (rangeStart) {
|
||||
// throw this range away if it's not valid, but others
|
||||
// can still match.
|
||||
if (c > rangeStart) {
|
||||
ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c));
|
||||
}
|
||||
else if (c === rangeStart) {
|
||||
ranges.push(braceEscape(c));
|
||||
}
|
||||
rangeStart = '';
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
// now might be the start of a range.
|
||||
// can be either c-d or c-] or c<more...>] or c] at this point
|
||||
if (glob.startsWith('-]', i + 1)) {
|
||||
ranges.push(braceEscape(c + '-'));
|
||||
i += 2;
|
||||
continue;
|
||||
}
|
||||
if (glob.startsWith('-', i + 1)) {
|
||||
rangeStart = c;
|
||||
i += 2;
|
||||
continue;
|
||||
}
|
||||
// not the start of a range, just a single character
|
||||
ranges.push(braceEscape(c));
|
||||
i++;
|
||||
}
|
||||
if (endPos < i) {
|
||||
// didn't see the end of the class, not a valid class,
|
||||
// but might still be valid as a literal match.
|
||||
return ['', false, 0, false];
|
||||
}
|
||||
// if we got no ranges and no negates, then we have a range that
|
||||
// cannot possibly match anything, and that poisons the whole glob
|
||||
if (!ranges.length && !negs.length) {
|
||||
return ['$.', false, glob.length - pos, true];
|
||||
}
|
||||
// if we got one positive range, and it's a single character, then that's
|
||||
// not actually a magic pattern, it's just that one literal character.
|
||||
// we should not treat that as "magic", we should just return the literal
|
||||
// character. [_] is a perfectly valid way to escape glob magic chars.
|
||||
if (negs.length === 0 &&
|
||||
ranges.length === 1 &&
|
||||
/^\\?.$/.test(ranges[0]) &&
|
||||
!negate) {
|
||||
const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
|
||||
return [regexpEscape(r), false, endPos - pos, false];
|
||||
}
|
||||
const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';
|
||||
const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';
|
||||
const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'
|
||||
: ranges.length ? sranges
|
||||
: snegs;
|
||||
return [comb, uflag, endPos - pos, true];
|
||||
};
|
||||
//# sourceMappingURL=brace-expressions.js.map
|
||||
File diff suppressed because one or more lines are too long
15
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/escape.d.ts
generated
vendored
15
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/escape.d.ts
generated
vendored
|
|
@ -1,15 +0,0 @@
|
|||
import type { MinimatchOptions } from './index.js';
|
||||
/**
|
||||
* Escape all magic characters in a glob pattern.
|
||||
*
|
||||
* If the {@link MinimatchOptions.windowsPathsNoEscape}
|
||||
* option is used, then characters are escaped by wrapping in `[]`, because
|
||||
* a magic character wrapped in a character class can only be satisfied by
|
||||
* that exact character. In this mode, `\` is _not_ escaped, because it is
|
||||
* not interpreted as a magic character, but instead as a path separator.
|
||||
*
|
||||
* If the {@link MinimatchOptions.magicalBraces} option is used,
|
||||
* then braces (`{` and `}`) will be escaped.
|
||||
*/
|
||||
export declare const escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
|
||||
//# sourceMappingURL=escape.d.ts.map
|
||||
1
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/escape.d.ts.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/escape.d.ts.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,MAAM,GACjB,GAAG,MAAM,EACT,2CAGG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,eAAe,CAAM,WAazE,CAAA"}
|
||||
26
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/escape.js
generated
vendored
26
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/escape.js
generated
vendored
|
|
@ -1,26 +0,0 @@
|
|||
/**
|
||||
* Escape all magic characters in a glob pattern.
|
||||
*
|
||||
* If the {@link MinimatchOptions.windowsPathsNoEscape}
|
||||
* option is used, then characters are escaped by wrapping in `[]`, because
|
||||
* a magic character wrapped in a character class can only be satisfied by
|
||||
* that exact character. In this mode, `\` is _not_ escaped, because it is
|
||||
* not interpreted as a magic character, but instead as a path separator.
|
||||
*
|
||||
* If the {@link MinimatchOptions.magicalBraces} option is used,
|
||||
* then braces (`{` and `}`) will be escaped.
|
||||
*/
|
||||
export const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => {
|
||||
// don't need to escape +@! because we escape the parens
|
||||
// that make those magic, and escaping ! as [!] isn't valid,
|
||||
// because [!]] is a valid glob class meaning not ']'.
|
||||
if (magicalBraces) {
|
||||
return windowsPathsNoEscape ?
|
||||
s.replace(/[?*()[\]{}]/g, '[$&]')
|
||||
: s.replace(/[?*()[\]\\{}]/g, '\\$&');
|
||||
}
|
||||
return windowsPathsNoEscape ?
|
||||
s.replace(/[?*()[\]]/g, '[$&]')
|
||||
: s.replace(/[?*()[\]\\]/g, '\\$&');
|
||||
};
|
||||
//# sourceMappingURL=escape.js.map
|
||||
1
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/escape.js.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/escape.js.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"escape.js","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,KAAK,MAC+C,EAAE,EACxE,EAAE;IACF,wDAAwD;IACxD,4DAA4D;IAC5D,sDAAsD;IACtD,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC;YACnC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;IACzC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC;QACjC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;AACvC,CAAC,CAAA","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character. In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n *\n * If the {@link MinimatchOptions.magicalBraces} option is used,\n * then braces (`{` and `}`) will be escaped.\n */\nexport const escape = (\n s: string,\n {\n windowsPathsNoEscape = false,\n magicalBraces = false,\n }: Pick<MinimatchOptions, 'windowsPathsNoEscape' | 'magicalBraces'> = {},\n) => {\n // don't need to escape +@! because we escape the parens\n // that make those magic, and escaping ! as [!] isn't valid,\n // because [!]] is a valid glob class meaning not ']'.\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]{}]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\{}]/g, '\\\\$&')\n }\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&')\n}\n"]}
|
||||
174
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/index.d.ts
generated
vendored
174
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/index.d.ts
generated
vendored
|
|
@ -1,174 +0,0 @@
|
|||
import { AST } from './ast.js';
|
||||
export type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd';
|
||||
export interface MinimatchOptions {
|
||||
/** do not expand `{x,y}` style braces */
|
||||
nobrace?: boolean;
|
||||
/** do not treat patterns starting with `#` as a comment */
|
||||
nocomment?: boolean;
|
||||
/** do not treat patterns starting with `!` as a negation */
|
||||
nonegate?: boolean;
|
||||
/** print LOTS of debugging output */
|
||||
debug?: boolean;
|
||||
/** treat `**` the same as `*` */
|
||||
noglobstar?: boolean;
|
||||
/** do not expand extglobs like `+(a|b)` */
|
||||
noext?: boolean;
|
||||
/** return the pattern if nothing matches */
|
||||
nonull?: boolean;
|
||||
/** treat `\\` as a path separator, not an escape character */
|
||||
windowsPathsNoEscape?: boolean;
|
||||
/**
|
||||
* inverse of {@link MinimatchOptions.windowsPathsNoEscape}
|
||||
* @deprecated
|
||||
*/
|
||||
allowWindowsEscape?: boolean;
|
||||
/**
|
||||
* Compare a partial path to a pattern. As long as the parts
|
||||
* of the path that are present are not contradicted by the
|
||||
* pattern, it will be treated as a match. This is useful in
|
||||
* applications where you're walking through a folder structure,
|
||||
* and don't yet have the full path, but want to ensure that you
|
||||
* do not walk down paths that can never be a match.
|
||||
*/
|
||||
partial?: boolean;
|
||||
/** allow matches that start with `.` even if the pattern does not */
|
||||
dot?: boolean;
|
||||
/** ignore case */
|
||||
nocase?: boolean;
|
||||
/** ignore case only in wildcard patterns */
|
||||
nocaseMagicOnly?: boolean;
|
||||
/** consider braces to be "magic" for the purpose of `hasMagic` */
|
||||
magicalBraces?: boolean;
|
||||
/**
|
||||
* If set, then patterns without slashes will be matched
|
||||
* against the basename of the path if it contains slashes.
|
||||
* For example, `a?b` would match the path `/xyz/123/acb`, but
|
||||
* not `/xyz/acb/123`.
|
||||
*/
|
||||
matchBase?: boolean;
|
||||
/** invert the results of negated matches */
|
||||
flipNegate?: boolean;
|
||||
/** do not collapse multiple `/` into a single `/` */
|
||||
preserveMultipleSlashes?: boolean;
|
||||
/**
|
||||
* A number indicating the level of optimization that should be done
|
||||
* to the pattern prior to parsing and using it for matches.
|
||||
*/
|
||||
optimizationLevel?: number;
|
||||
/** operating system platform */
|
||||
platform?: Platform;
|
||||
/**
|
||||
* When a pattern starts with a UNC path or drive letter, and in
|
||||
* `nocase:true` mode, do not convert the root portions of the
|
||||
* pattern into a case-insensitive regular expression, and instead
|
||||
* leave them as strings.
|
||||
*
|
||||
* This is the default when the platform is `win32` and
|
||||
* `nocase:true` is set.
|
||||
*/
|
||||
windowsNoMagicRoot?: boolean;
|
||||
/**
|
||||
* max number of `{...}` patterns to expand. Default 100_000.
|
||||
*/
|
||||
braceExpandMax?: number;
|
||||
/**
|
||||
* Max number of non-adjacent `**` patterns to recursively walk down.
|
||||
*
|
||||
* The default of 200 is almost certainly high enough for most purposes,
|
||||
* and can handle absurdly excessive patterns.
|
||||
*/
|
||||
maxGlobstarRecursion?: number;
|
||||
/**
|
||||
* Max depth to traverse for nested extglobs like `*(a|b|c)`
|
||||
*
|
||||
* Default is 2, which is quite low, but any higher value
|
||||
* swiftly results in punishing performance impacts. Note
|
||||
* that this is *not* relevant when the globstar types can
|
||||
* be safely coalesced into a single set.
|
||||
*
|
||||
* For example, `*(a|@(b|c)|d)` would be flattened into
|
||||
* `*(a|b|c|d)`. Thus, many common extglobs will retain good
|
||||
* performance and never hit this limit, even if they are
|
||||
* excessively deep and complicated.
|
||||
*
|
||||
* If the limit is hit, then the extglob characters are simply
|
||||
* not parsed, and the pattern effectively switches into
|
||||
* `noextglob: true` mode for the contents of that nested
|
||||
* sub-pattern. This will typically _not_ result in a match,
|
||||
* but is considered a valid trade-off for security and
|
||||
* performance.
|
||||
*/
|
||||
maxExtglobRecursion?: number;
|
||||
}
|
||||
export declare const minimatch: {
|
||||
(p: string, pattern: string, options?: MinimatchOptions): boolean;
|
||||
sep: Sep;
|
||||
GLOBSTAR: typeof GLOBSTAR;
|
||||
filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
|
||||
defaults: (def: MinimatchOptions) => typeof minimatch;
|
||||
braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
|
||||
makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
|
||||
match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
|
||||
AST: typeof AST;
|
||||
Minimatch: typeof Minimatch;
|
||||
escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
|
||||
unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
|
||||
};
|
||||
export type Sep = '\\' | '/';
|
||||
export declare const sep: Sep;
|
||||
export declare const GLOBSTAR: unique symbol;
|
||||
export declare const filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
|
||||
export declare const defaults: (def: MinimatchOptions) => typeof minimatch;
|
||||
export declare const braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
|
||||
export declare const makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
|
||||
export declare const match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
|
||||
export type MMRegExp = RegExp & {
|
||||
_src?: string;
|
||||
_glob?: string;
|
||||
};
|
||||
export type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR;
|
||||
export type ParseReturn = ParseReturnFiltered | false;
|
||||
export declare class Minimatch {
|
||||
#private;
|
||||
options: MinimatchOptions;
|
||||
set: ParseReturnFiltered[][];
|
||||
pattern: string;
|
||||
windowsPathsNoEscape: boolean;
|
||||
nonegate: boolean;
|
||||
negate: boolean;
|
||||
comment: boolean;
|
||||
empty: boolean;
|
||||
preserveMultipleSlashes: boolean;
|
||||
partial: boolean;
|
||||
globSet: string[];
|
||||
globParts: string[][];
|
||||
nocase: boolean;
|
||||
isWindows: boolean;
|
||||
platform: Platform;
|
||||
windowsNoMagicRoot: boolean;
|
||||
maxGlobstarRecursion: number;
|
||||
regexp: false | null | MMRegExp;
|
||||
constructor(pattern: string, options?: MinimatchOptions);
|
||||
hasMagic(): boolean;
|
||||
debug(..._: unknown[]): void;
|
||||
make(): void;
|
||||
preprocess(globParts: string[][]): string[][];
|
||||
adjascentGlobstarOptimize(globParts: string[][]): string[][];
|
||||
levelOneOptimize(globParts: string[][]): string[][];
|
||||
levelTwoFileOptimize(parts: string | string[]): string[];
|
||||
firstPhasePreProcess(globParts: string[][]): string[][];
|
||||
secondPhasePreProcess(globParts: string[][]): string[][];
|
||||
partsMatch(a: string[], b: string[], emptyGSMatch?: boolean): false | string[];
|
||||
parseNegate(): void;
|
||||
matchOne(file: string[], pattern: ParseReturn[], partial?: boolean): boolean;
|
||||
braceExpand(): string[];
|
||||
parse(pattern: string): ParseReturn;
|
||||
makeRe(): false | MMRegExp;
|
||||
slashSplit(p: string): string[];
|
||||
match(f: string, partial?: boolean): boolean;
|
||||
static defaults(def: MinimatchOptions): typeof Minimatch;
|
||||
}
|
||||
export { AST } from './ast.js';
|
||||
export { escape } from './escape.js';
|
||||
export { unescape } from './unescape.js';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/index.d.ts.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/index.d.ts.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"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"}
|
||||
1114
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/index.js
generated
vendored
1114
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/index.js
generated
vendored
File diff suppressed because it is too large
Load diff
1
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/index.js.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
3
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/package.json
generated
vendored
3
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/package.json
generated
vendored
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"type": "module"
|
||||
}
|
||||
22
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/unescape.d.ts
generated
vendored
22
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/unescape.d.ts
generated
vendored
|
|
@ -1,22 +0,0 @@
|
|||
import type { MinimatchOptions } from './index.js';
|
||||
/**
|
||||
* Un-escape a string that has been escaped with {@link escape}.
|
||||
*
|
||||
* If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
|
||||
* square-bracket escapes are removed, but not backslash escapes.
|
||||
*
|
||||
* For example, it will turn the string `'[*]'` into `*`, but it will not
|
||||
* turn `'\\*'` into `'*'`, because `\` is a path separator in
|
||||
* `windowsPathsNoEscape` mode.
|
||||
*
|
||||
* When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
|
||||
* backslash escapes are removed.
|
||||
*
|
||||
* Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
|
||||
* or unescaped.
|
||||
*
|
||||
* When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
|
||||
* unescaped.
|
||||
*/
|
||||
export declare const unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
|
||||
//# sourceMappingURL=unescape.d.ts.map
|
||||
1
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/unescape.d.ts.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/unescape.d.ts.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"unescape.d.ts","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,EACT,2CAGG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,eAAe,CAAM,WAczE,CAAA"}
|
||||
34
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/unescape.js
generated
vendored
34
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/unescape.js
generated
vendored
|
|
@ -1,34 +0,0 @@
|
|||
/**
|
||||
* Un-escape a string that has been escaped with {@link escape}.
|
||||
*
|
||||
* If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
|
||||
* square-bracket escapes are removed, but not backslash escapes.
|
||||
*
|
||||
* For example, it will turn the string `'[*]'` into `*`, but it will not
|
||||
* turn `'\\*'` into `'*'`, because `\` is a path separator in
|
||||
* `windowsPathsNoEscape` mode.
|
||||
*
|
||||
* When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
|
||||
* backslash escapes are removed.
|
||||
*
|
||||
* Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
|
||||
* or unescaped.
|
||||
*
|
||||
* When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
|
||||
* unescaped.
|
||||
*/
|
||||
export const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
|
||||
if (magicalBraces) {
|
||||
return windowsPathsNoEscape ?
|
||||
s.replace(/\[([^/\\])\]/g, '$1')
|
||||
: s
|
||||
.replace(/((?!\\).|^)\[([^/\\])\]/g, '$1$2')
|
||||
.replace(/\\([^/])/g, '$1');
|
||||
}
|
||||
return windowsPathsNoEscape ?
|
||||
s.replace(/\[([^/\\{}])\]/g, '$1')
|
||||
: s
|
||||
.replace(/((?!\\).|^)\[([^/\\{}])\]/g, '$1$2')
|
||||
.replace(/\\([^/{}])/g, '$1');
|
||||
};
|
||||
//# sourceMappingURL=unescape.js.map
|
||||
1
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/unescape.js.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/minimatch/dist/esm/unescape.js.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"unescape.js","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,IAAI,MACgD,EAAE,EACxE,EAAE;IACF,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC;YAClC,CAAC,CAAC,CAAC;iBACE,OAAO,CAAC,0BAA0B,EAAE,MAAM,CAAC;iBAC3C,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC;QACpC,CAAC,CAAC,CAAC;aACE,OAAO,CAAC,4BAA4B,EAAE,MAAM,CAAC;aAC7C,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,CAAA;AACrC,CAAC,CAAA","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then\n * square-bracket escapes are removed, but not backslash escapes.\n *\n * For example, it will turn the string `'[*]'` into `*`, but it will not\n * turn `'\\\\*'` into `'*'`, because `\\` is a path separator in\n * `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n *\n * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be\n * unescaped.\n */\n\nexport const unescape = (\n s: string,\n {\n windowsPathsNoEscape = false,\n magicalBraces = true,\n }: Pick<MinimatchOptions, 'windowsPathsNoEscape' | 'magicalBraces'> = {},\n) => {\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\])\\]/g, '$1$2')\n .replace(/\\\\([^/])/g, '$1')\n }\n return windowsPathsNoEscape ?\n s.replace(/\\[([^/\\\\{}])\\]/g, '$1')\n : s\n .replace(/((?!\\\\).|^)\\[([^/\\\\{}])\\]/g, '$1$2')\n .replace(/\\\\([^/{}])/g, '$1')\n}\n"]}
|
||||
73
electron/node_modules/rimraf/node_modules/minimatch/package.json
generated
vendored
73
electron/node_modules/rimraf/node_modules/minimatch/package.json
generated
vendored
|
|
@ -1,73 +0,0 @@
|
|||
{
|
||||
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
|
||||
"name": "minimatch",
|
||||
"description": "a glob matcher in javascript",
|
||||
"version": "10.2.5",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:isaacs/minimatch"
|
||||
},
|
||||
"main": "./dist/commonjs/index.js",
|
||||
"types": "./dist/commonjs/index.d.ts",
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./dist/esm/index.d.ts",
|
||||
"default": "./dist/esm/index.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/commonjs/index.d.ts",
|
||||
"default": "./dist/commonjs/index.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"preversion": "npm test",
|
||||
"postversion": "npm publish",
|
||||
"prepublishOnly": "git push origin --follow-tags",
|
||||
"prepare": "tshy",
|
||||
"pretest": "npm run prepare",
|
||||
"presnap": "npm run prepare",
|
||||
"test": "tap",
|
||||
"snap": "tap",
|
||||
"format": "prettier --write .",
|
||||
"benchmark": "node benchmark/index.js",
|
||||
"typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts",
|
||||
"lint": "oxlint --fix src test",
|
||||
"postsnap": "npm run lint",
|
||||
"postlint": "npm run format"
|
||||
},
|
||||
"engines": {
|
||||
"node": "18 || 20 || >=22"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^25.5.0",
|
||||
"mkdirp": "^3.0.1",
|
||||
"oxlint": "^1.57.0",
|
||||
"oxlint-tsgolint": "^0.18.1",
|
||||
"prettier": "^3.8.1",
|
||||
"tap": "^21.6.2",
|
||||
"tshy": "^4.0.0",
|
||||
"typedoc": "^0.28.18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
},
|
||||
"license": "BlueOak-1.0.0",
|
||||
"tshy": {
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"selfLink": false
|
||||
},
|
||||
"type": "module",
|
||||
"module": "./dist/esm/index.js",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^5.0.5"
|
||||
}
|
||||
}
|
||||
55
electron/node_modules/rimraf/node_modules/minipass/LICENSE.md
generated
vendored
55
electron/node_modules/rimraf/node_modules/minipass/LICENSE.md
generated
vendored
|
|
@ -1,55 +0,0 @@
|
|||
# Blue Oak Model License
|
||||
|
||||
Version 1.0.0
|
||||
|
||||
## Purpose
|
||||
|
||||
This license gives everyone as much permission to work with
|
||||
this software as possible, while protecting contributors
|
||||
from liability.
|
||||
|
||||
## Acceptance
|
||||
|
||||
In order to receive this license, you must agree to its
|
||||
rules. The rules of this license are both obligations
|
||||
under that agreement and conditions to your license.
|
||||
You must not do anything with this software that triggers
|
||||
a rule that you cannot or will not follow.
|
||||
|
||||
## Copyright
|
||||
|
||||
Each contributor licenses you to do everything with this
|
||||
software that would otherwise infringe that contributor's
|
||||
copyright in it.
|
||||
|
||||
## Notices
|
||||
|
||||
You must ensure that everyone who gets a copy of
|
||||
any part of this software from you, with or without
|
||||
changes, also gets the text of this license or a link to
|
||||
<https://blueoakcouncil.org/license/1.0.0>.
|
||||
|
||||
## Excuse
|
||||
|
||||
If anyone notifies you in writing that you have not
|
||||
complied with [Notices](#notices), you can keep your
|
||||
license by taking all practical steps to comply within 30
|
||||
days after the notice. If you do not do so, your license
|
||||
ends immediately.
|
||||
|
||||
## Patent
|
||||
|
||||
Each contributor licenses you to do everything with this
|
||||
software that would otherwise infringe any patent claims
|
||||
they can license or become able to license.
|
||||
|
||||
## Reliability
|
||||
|
||||
No contributor can revoke this license.
|
||||
|
||||
## No Liability
|
||||
|
||||
***As far as the law allows, this software comes as is,
|
||||
without any warranty or condition, and no contributor
|
||||
will be liable to anyone for any damages related to this
|
||||
software or this license, under any kind of legal claim.***
|
||||
825
electron/node_modules/rimraf/node_modules/minipass/README.md
generated
vendored
825
electron/node_modules/rimraf/node_modules/minipass/README.md
generated
vendored
|
|
@ -1,825 +0,0 @@
|
|||
# minipass
|
||||
|
||||
A _very_ minimal implementation of a [PassThrough
|
||||
stream](https://nodejs.org/api/stream.html#stream_class_stream_passthrough)
|
||||
|
||||
[It's very
|
||||
fast](https://docs.google.com/spreadsheets/d/1K_HR5oh3r80b8WVMWCPPjfuWXUgfkmhlX7FGI6JJ8tY/edit?usp=sharing)
|
||||
for objects, strings, and buffers.
|
||||
|
||||
Supports `pipe()`ing (including multi-`pipe()` and backpressure
|
||||
transmission), buffering data until either a `data` event handler
|
||||
or `pipe()` is added (so you don't lose the first chunk), and
|
||||
most other cases where PassThrough is a good idea.
|
||||
|
||||
There is a `read()` method, but it's much more efficient to
|
||||
consume data from this stream via `'data'` events or by calling
|
||||
`pipe()` into some other stream. Calling `read()` requires the
|
||||
buffer to be flattened in some cases, which requires copying
|
||||
memory.
|
||||
|
||||
If you set `objectMode: true` in the options, then whatever is
|
||||
written will be emitted. Otherwise, it'll do a minimal amount of
|
||||
Buffer copying to ensure proper Streams semantics when `read(n)`
|
||||
is called.
|
||||
|
||||
`objectMode` can only be set at instantiation. Attempting to
|
||||
write something other than a String or Buffer without having set
|
||||
`objectMode` in the options will throw an error.
|
||||
|
||||
This is not a `through` or `through2` stream. It doesn't
|
||||
transform the data, it just passes it right through. If you want
|
||||
to transform the data, extend the class, and override the
|
||||
`write()` method. Once you're done transforming the data however
|
||||
you want, call `super.write()` with the transform output.
|
||||
|
||||
For some examples of streams that extend Minipass in various
|
||||
ways, check out:
|
||||
|
||||
- [minizlib](http://npm.im/minizlib)
|
||||
- [fs-minipass](http://npm.im/fs-minipass)
|
||||
- [tar](http://npm.im/tar)
|
||||
- [minipass-collect](http://npm.im/minipass-collect)
|
||||
- [minipass-flush](http://npm.im/minipass-flush)
|
||||
- [minipass-pipeline](http://npm.im/minipass-pipeline)
|
||||
- [tap](http://npm.im/tap)
|
||||
- [tap-parser](http://npm.im/tap-parser)
|
||||
- [treport](http://npm.im/treport)
|
||||
- [minipass-fetch](http://npm.im/minipass-fetch)
|
||||
- [pacote](http://npm.im/pacote)
|
||||
- [make-fetch-happen](http://npm.im/make-fetch-happen)
|
||||
- [cacache](http://npm.im/cacache)
|
||||
- [ssri](http://npm.im/ssri)
|
||||
- [npm-registry-fetch](http://npm.im/npm-registry-fetch)
|
||||
- [minipass-json-stream](http://npm.im/minipass-json-stream)
|
||||
- [minipass-sized](http://npm.im/minipass-sized)
|
||||
|
||||
## Usage in TypeScript
|
||||
|
||||
The `Minipass` class takes three type template definitions:
|
||||
|
||||
- `RType` the type being read, which defaults to `Buffer`. If
|
||||
`RType` is `string`, then the constructor _must_ get an options
|
||||
object specifying either an `encoding` or `objectMode: true`.
|
||||
If it's anything other than `string` or `Buffer`, then it
|
||||
_must_ get an options object specifying `objectMode: true`.
|
||||
- `WType` the type being written. If `RType` is `Buffer` or
|
||||
`string`, then this defaults to `ContiguousData` (Buffer,
|
||||
string, ArrayBuffer, or ArrayBufferView). Otherwise, it
|
||||
defaults to `RType`.
|
||||
- `Events` type mapping event names to the arguments emitted
|
||||
with that event, which extends `Minipass.Events`.
|
||||
|
||||
To declare types for custom events in subclasses, extend the
|
||||
third parameter with your own event signatures. For example:
|
||||
|
||||
```js
|
||||
import { Minipass } from 'minipass'
|
||||
|
||||
// a NDJSON stream that emits 'jsonError' when it can't stringify
|
||||
export interface Events extends Minipass.Events {
|
||||
jsonError: [e: Error]
|
||||
}
|
||||
|
||||
export class NDJSONStream extends Minipass<string, any, Events> {
|
||||
constructor() {
|
||||
super({ objectMode: true })
|
||||
}
|
||||
|
||||
// data is type `any` because that's WType
|
||||
write(data, encoding, cb) {
|
||||
try {
|
||||
const json = JSON.stringify(data)
|
||||
return super.write(json + '\n', encoding, cb)
|
||||
} catch (er) {
|
||||
if (!er instanceof Error) {
|
||||
er = Object.assign(new Error('json stringify failed'), {
|
||||
cause: er,
|
||||
})
|
||||
}
|
||||
// trying to emit with something OTHER than an error will
|
||||
// fail, because we declared the event arguments type.
|
||||
this.emit('jsonError', er)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const s = new NDJSONStream()
|
||||
s.on('jsonError', e => {
|
||||
// here, TS knows that e is an Error
|
||||
})
|
||||
```
|
||||
|
||||
Emitting/handling events that aren't declared in this way is
|
||||
fine, but the arguments will be typed as `unknown`.
|
||||
|
||||
## Differences from Node.js Streams
|
||||
|
||||
There are several things that make Minipass streams different
|
||||
from (and in some ways superior to) Node.js core streams.
|
||||
|
||||
Please read these caveats if you are familiar with node-core
|
||||
streams and intend to use Minipass streams in your programs.
|
||||
|
||||
You can avoid most of these differences entirely (for a very
|
||||
small performance penalty) by setting `{async: true}` in the
|
||||
constructor options.
|
||||
|
||||
### Timing
|
||||
|
||||
Minipass streams are designed to support synchronous use-cases.
|
||||
Thus, data is emitted as soon as it is available, always. It is
|
||||
buffered until read, but no longer. Another way to look at it is
|
||||
that Minipass streams are exactly as synchronous as the logic
|
||||
that writes into them.
|
||||
|
||||
This can be surprising if your code relies on
|
||||
`PassThrough.write()` always providing data on the next tick
|
||||
rather than the current one, or being able to call `resume()` and
|
||||
not have the entire buffer disappear immediately.
|
||||
|
||||
However, without this synchronicity guarantee, there would be no
|
||||
way for Minipass to achieve the speeds it does, or support the
|
||||
synchronous use cases that it does. Simply put, waiting takes
|
||||
time.
|
||||
|
||||
This non-deferring approach makes Minipass streams much easier to
|
||||
reason about, especially in the context of Promises and other
|
||||
flow-control mechanisms.
|
||||
|
||||
Example:
|
||||
|
||||
```js
|
||||
// hybrid module, either works
|
||||
import { Minipass } from 'minipass'
|
||||
// or:
|
||||
const { Minipass } = require('minipass')
|
||||
|
||||
const stream = new Minipass()
|
||||
stream.on('data', () => console.log('data event'))
|
||||
console.log('before write')
|
||||
stream.write('hello')
|
||||
console.log('after write')
|
||||
// output:
|
||||
// before write
|
||||
// data event
|
||||
// after write
|
||||
```
|
||||
|
||||
### Exception: Async Opt-In
|
||||
|
||||
If you wish to have a Minipass stream with behavior that more
|
||||
closely mimics Node.js core streams, you can set the stream in
|
||||
async mode either by setting `async: true` in the constructor
|
||||
options, or by setting `stream.async = true` later on.
|
||||
|
||||
```js
|
||||
// hybrid module, either works
|
||||
import { Minipass } from 'minipass'
|
||||
// or:
|
||||
const { Minipass } = require('minipass')
|
||||
|
||||
const asyncStream = new Minipass({ async: true })
|
||||
asyncStream.on('data', () => console.log('data event'))
|
||||
console.log('before write')
|
||||
asyncStream.write('hello')
|
||||
console.log('after write')
|
||||
// output:
|
||||
// before write
|
||||
// after write
|
||||
// data event <-- this is deferred until the next tick
|
||||
```
|
||||
|
||||
Switching _out_ of async mode is unsafe, as it could cause data
|
||||
corruption, and so is not enabled. Example:
|
||||
|
||||
```js
|
||||
import { Minipass } from 'minipass'
|
||||
const stream = new Minipass({ encoding: 'utf8' })
|
||||
stream.on('data', chunk => console.log(chunk))
|
||||
stream.async = true
|
||||
console.log('before writes')
|
||||
stream.write('hello')
|
||||
setStreamSyncAgainSomehow(stream) // <-- this doesn't actually exist!
|
||||
stream.write('world')
|
||||
console.log('after writes')
|
||||
// hypothetical output would be:
|
||||
// before writes
|
||||
// world
|
||||
// after writes
|
||||
// hello
|
||||
// NOT GOOD!
|
||||
```
|
||||
|
||||
To avoid this problem, once set into async mode, any attempt to
|
||||
make the stream sync again will be ignored.
|
||||
|
||||
```js
|
||||
const { Minipass } = require('minipass')
|
||||
const stream = new Minipass({ encoding: 'utf8' })
|
||||
stream.on('data', chunk => console.log(chunk))
|
||||
stream.async = true
|
||||
console.log('before writes')
|
||||
stream.write('hello')
|
||||
stream.async = false // <-- no-op, stream already async
|
||||
stream.write('world')
|
||||
console.log('after writes')
|
||||
// actual output:
|
||||
// before writes
|
||||
// after writes
|
||||
// hello
|
||||
// world
|
||||
```
|
||||
|
||||
### No High/Low Water Marks
|
||||
|
||||
Node.js core streams will optimistically fill up a buffer,
|
||||
returning `true` on all writes until the limit is hit, even if
|
||||
the data has nowhere to go. Then, they will not attempt to draw
|
||||
more data in until the buffer size dips below a minimum value.
|
||||
|
||||
Minipass streams are much simpler. The `write()` method will
|
||||
return `true` if the data has somewhere to go (which is to say,
|
||||
given the timing guarantees, that the data is already there by
|
||||
the time `write()` returns).
|
||||
|
||||
If the data has nowhere to go, then `write()` returns false, and
|
||||
the data sits in a buffer, to be drained out immediately as soon
|
||||
as anyone consumes it.
|
||||
|
||||
Since nothing is ever buffered unnecessarily, there is much less
|
||||
copying data, and less bookkeeping about buffer capacity levels.
|
||||
|
||||
### Hazards of Buffering (or: Why Minipass Is So Fast)
|
||||
|
||||
Since data written to a Minipass stream is immediately written
|
||||
all the way through the pipeline, and `write()` always returns
|
||||
true/false based on whether the data was fully flushed,
|
||||
backpressure is communicated immediately to the upstream caller.
|
||||
This minimizes buffering.
|
||||
|
||||
Consider this case:
|
||||
|
||||
```js
|
||||
const { PassThrough } = require('stream')
|
||||
const p1 = new PassThrough({ highWaterMark: 1024 })
|
||||
const p2 = new PassThrough({ highWaterMark: 1024 })
|
||||
const p3 = new PassThrough({ highWaterMark: 1024 })
|
||||
const p4 = new PassThrough({ highWaterMark: 1024 })
|
||||
|
||||
p1.pipe(p2).pipe(p3).pipe(p4)
|
||||
p4.on('data', () => console.log('made it through'))
|
||||
|
||||
// this returns false and buffers, then writes to p2 on next tick (1)
|
||||
// p2 returns false and buffers, pausing p1, then writes to p3 on next tick (2)
|
||||
// p3 returns false and buffers, pausing p2, then writes to p4 on next tick (3)
|
||||
// p4 returns false and buffers, pausing p3, then emits 'data' and 'drain'
|
||||
// on next tick (4)
|
||||
// p3 sees p4's 'drain' event, and calls resume(), emitting 'resume' and
|
||||
// 'drain' on next tick (5)
|
||||
// p2 sees p3's 'drain', calls resume(), emits 'resume' and 'drain' on next tick (6)
|
||||
// p1 sees p2's 'drain', calls resume(), emits 'resume' and 'drain' on next
|
||||
// tick (7)
|
||||
|
||||
p1.write(Buffer.alloc(2048)) // returns false
|
||||
```
|
||||
|
||||
Along the way, the data was buffered and deferred at each stage,
|
||||
and multiple event deferrals happened, for an unblocked pipeline
|
||||
where it was perfectly safe to write all the way through!
|
||||
|
||||
Furthermore, setting a `highWaterMark` of `1024` might lead
|
||||
someone reading the code to think an advisory maximum of 1KiB is
|
||||
being set for the pipeline. However, the actual advisory
|
||||
buffering level is the _sum_ of `highWaterMark` values, since
|
||||
each one has its own bucket.
|
||||
|
||||
Consider the Minipass case:
|
||||
|
||||
```js
|
||||
const m1 = new Minipass()
|
||||
const m2 = new Minipass()
|
||||
const m3 = new Minipass()
|
||||
const m4 = new Minipass()
|
||||
|
||||
m1.pipe(m2).pipe(m3).pipe(m4)
|
||||
m4.on('data', () => console.log('made it through'))
|
||||
|
||||
// m1 is flowing, so it writes the data to m2 immediately
|
||||
// m2 is flowing, so it writes the data to m3 immediately
|
||||
// m3 is flowing, so it writes the data to m4 immediately
|
||||
// m4 is flowing, so it fires the 'data' event immediately, returns true
|
||||
// m4's write returned true, so m3 is still flowing, returns true
|
||||
// m3's write returned true, so m2 is still flowing, returns true
|
||||
// m2's write returned true, so m1 is still flowing, returns true
|
||||
// No event deferrals or buffering along the way!
|
||||
|
||||
m1.write(Buffer.alloc(2048)) // returns true
|
||||
```
|
||||
|
||||
It is extremely unlikely that you _don't_ want to buffer any data
|
||||
written, or _ever_ buffer data that can be flushed all the way
|
||||
through. Neither node-core streams nor Minipass ever fail to
|
||||
buffer written data, but node-core streams do a lot of
|
||||
unnecessary buffering and pausing.
|
||||
|
||||
As always, the faster implementation is the one that does less
|
||||
stuff and waits less time to do it.
|
||||
|
||||
### Immediately emit `end` for empty streams (when not paused)
|
||||
|
||||
If a stream is not paused, and `end()` is called before writing
|
||||
any data into it, then it will emit `end` immediately.
|
||||
|
||||
If you have logic that occurs on the `end` event which you don't
|
||||
want to potentially happen immediately (for example, closing file
|
||||
descriptors, moving on to the next entry in an archive parse
|
||||
stream, etc.) then be sure to call `stream.pause()` on creation,
|
||||
and then `stream.resume()` once you are ready to respond to the
|
||||
`end` event.
|
||||
|
||||
However, this is _usually_ not a problem because:
|
||||
|
||||
### Emit `end` When Asked
|
||||
|
||||
One hazard of immediately emitting `'end'` is that you may not
|
||||
yet have had a chance to add a listener. In order to avoid this
|
||||
hazard, Minipass streams safely re-emit the `'end'` event if a
|
||||
new listener is added after `'end'` has been emitted.
|
||||
|
||||
Ie, if you do `stream.on('end', someFunction)`, and the stream
|
||||
has already emitted `end`, then it will call the handler right
|
||||
away. (You can think of this somewhat like attaching a new
|
||||
`.then(fn)` to a previously-resolved Promise.)
|
||||
|
||||
To prevent calling handlers multiple times who would not expect
|
||||
multiple ends to occur, all listeners are removed from the
|
||||
`'end'` event whenever it is emitted.
|
||||
|
||||
### Emit `error` When Asked
|
||||
|
||||
The most recent error object passed to the `'error'` event is
|
||||
stored on the stream. If a new `'error'` event handler is added,
|
||||
and an error was previously emitted, then the event handler will
|
||||
be called immediately (or on `process.nextTick` in the case of
|
||||
async streams).
|
||||
|
||||
This makes it much more difficult to end up trying to interact
|
||||
with a broken stream, if the error handler is added after an
|
||||
error was previously emitted.
|
||||
|
||||
### Impact of "immediate flow" on Tee-streams
|
||||
|
||||
A "tee stream" is a stream piping to multiple destinations:
|
||||
|
||||
```js
|
||||
const tee = new Minipass()
|
||||
t.pipe(dest1)
|
||||
t.pipe(dest2)
|
||||
t.write('foo') // goes to both destinations
|
||||
```
|
||||
|
||||
Since Minipass streams _immediately_ process any pending data
|
||||
through the pipeline when a new pipe destination is added, this
|
||||
can have surprising effects, especially when a stream comes in
|
||||
from some other function and may or may not have data in its
|
||||
buffer.
|
||||
|
||||
```js
|
||||
// WARNING! WILL LOSE DATA!
|
||||
const src = new Minipass()
|
||||
src.write('foo')
|
||||
src.pipe(dest1) // 'foo' chunk flows to dest1 immediately, and is gone
|
||||
src.pipe(dest2) // gets nothing!
|
||||
```
|
||||
|
||||
One solution is to create a dedicated tee-stream junction that
|
||||
pipes to both locations, and then pipe to _that_ instead.
|
||||
|
||||
```js
|
||||
// Safe example: tee to both places
|
||||
const src = new Minipass()
|
||||
src.write('foo')
|
||||
const tee = new Minipass()
|
||||
tee.pipe(dest1)
|
||||
tee.pipe(dest2)
|
||||
src.pipe(tee) // tee gets 'foo', pipes to both locations
|
||||
```
|
||||
|
||||
The same caveat applies to `on('data')` event listeners. The
|
||||
first one added will _immediately_ receive all of the data,
|
||||
leaving nothing for the second:
|
||||
|
||||
```js
|
||||
// WARNING! WILL LOSE DATA!
|
||||
const src = new Minipass()
|
||||
src.write('foo')
|
||||
src.on('data', handler1) // receives 'foo' right away
|
||||
src.on('data', handler2) // nothing to see here!
|
||||
```
|
||||
|
||||
Using a dedicated tee-stream can be used in this case as well:
|
||||
|
||||
```js
|
||||
// Safe example: tee to both data handlers
|
||||
const src = new Minipass()
|
||||
src.write('foo')
|
||||
const tee = new Minipass()
|
||||
tee.on('data', handler1)
|
||||
tee.on('data', handler2)
|
||||
src.pipe(tee)
|
||||
```
|
||||
|
||||
All of the hazards in this section are avoided by setting `{
|
||||
async: true }` in the Minipass constructor, or by setting
|
||||
`stream.async = true` afterwards. Note that this does add some
|
||||
overhead, so should only be done in cases where you are willing
|
||||
to lose a bit of performance in order to avoid having to refactor
|
||||
program logic.
|
||||
|
||||
## USAGE
|
||||
|
||||
It's a stream! Use it like a stream and it'll most likely do what
|
||||
you want.
|
||||
|
||||
```js
|
||||
import { Minipass } from 'minipass'
|
||||
const mp = new Minipass(options) // options is optional
|
||||
mp.write('foo')
|
||||
mp.pipe(someOtherStream)
|
||||
mp.end('bar')
|
||||
```
|
||||
|
||||
### OPTIONS
|
||||
|
||||
- `encoding` How would you like the data coming _out_ of the
|
||||
stream to be encoded? Accepts any values that can be passed to
|
||||
`Buffer.toString()`.
|
||||
- `objectMode` Emit data exactly as it comes in. This will be
|
||||
flipped on by default if you write() something other than a
|
||||
string or Buffer at any point. Setting `objectMode: true` will
|
||||
prevent setting any encoding value.
|
||||
- `async` Defaults to `false`. Set to `true` to defer data
|
||||
emission until next tick. This reduces performance slightly,
|
||||
but makes Minipass streams use timing behavior closer to Node
|
||||
core streams. See [Timing](#timing) for more details.
|
||||
- `signal` An `AbortSignal` that will cause the stream to unhook
|
||||
itself from everything and become as inert as possible. Note
|
||||
that providing a `signal` parameter will make `'error'` events
|
||||
no longer throw if they are unhandled, but they will still be
|
||||
emitted to handlers if any are attached.
|
||||
|
||||
### API
|
||||
|
||||
Implements the user-facing portions of Node.js's `Readable` and
|
||||
`Writable` streams.
|
||||
|
||||
### Methods
|
||||
|
||||
- `write(chunk, [encoding], [callback])` - Put data in. (Note
|
||||
that, in the base Minipass class, the same data will come out.)
|
||||
Returns `false` if the stream will buffer the next write, or
|
||||
true if it's still in "flowing" mode.
|
||||
- `end([chunk, [encoding]], [callback])` - Signal that you have
|
||||
no more data to write. This will queue an `end` event to be
|
||||
fired when all the data has been consumed.
|
||||
- `pause()` - No more data for a while, please. This also
|
||||
prevents `end` from being emitted for empty streams until the
|
||||
stream is resumed.
|
||||
- `resume()` - Resume the stream. If there's data in the buffer,
|
||||
it is all discarded. Any buffered events are immediately
|
||||
emitted.
|
||||
- `pipe(dest)` - Send all output to the stream provided. When
|
||||
data is emitted, it is immediately written to any and all pipe
|
||||
destinations. (Or written on next tick in `async` mode.)
|
||||
- `unpipe(dest)` - Stop piping to the destination stream. This is
|
||||
immediate, meaning that any asynchronously queued data will
|
||||
_not_ make it to the destination when running in `async` mode.
|
||||
- `options.end` - Boolean, end the destination stream when the
|
||||
source stream ends. Default `true`.
|
||||
- `options.proxyErrors` - Boolean, proxy `error` events from
|
||||
the source stream to the destination stream. Note that errors
|
||||
are _not_ proxied after the pipeline terminates, either due
|
||||
to the source emitting `'end'` or manually unpiping with
|
||||
`src.unpipe(dest)`. Default `false`.
|
||||
- `on(ev, fn)`, `emit(ev, fn)` - Minipass streams are
|
||||
EventEmitters. Some events are given special treatment,
|
||||
however. (See below under "events".)
|
||||
- `promise()` - Returns a Promise that resolves when the stream
|
||||
emits `end`, or rejects if the stream emits `error`.
|
||||
- `collect()` - Return a Promise that resolves on `end` with an
|
||||
array containing each chunk of data that was emitted, or
|
||||
rejects if the stream emits `error`. Note that this consumes
|
||||
the stream data.
|
||||
- `concat()` - Same as `collect()`, but concatenates the data
|
||||
into a single Buffer object. Will reject the returned promise
|
||||
if the stream is in objectMode, or if it goes into objectMode
|
||||
by the end of the data.
|
||||
- `read(n)` - Consume `n` bytes of data out of the buffer. If `n`
|
||||
is not provided, then consume all of it. If `n` bytes are not
|
||||
available, then it returns null. **Note** consuming streams in
|
||||
this way is less efficient, and can lead to unnecessary Buffer
|
||||
copying.
|
||||
- `destroy([er])` - Destroy the stream. If an error is provided,
|
||||
then an `'error'` event is emitted. If the stream has a
|
||||
`close()` method, and has not emitted a `'close'` event yet,
|
||||
then `stream.close()` will be called. Any Promises returned by
|
||||
`.promise()`, `.collect()` or `.concat()` will be rejected.
|
||||
After being destroyed, writing to the stream will emit an
|
||||
error. No more data will be emitted if the stream is destroyed,
|
||||
even if it was previously buffered.
|
||||
|
||||
### Properties
|
||||
|
||||
- `bufferLength` Read-only. Total number of bytes buffered, or in
|
||||
the case of objectMode, the total number of objects.
|
||||
- `encoding` Read-only. The encoding that has been set.
|
||||
- `flowing` Read-only. Boolean indicating whether a chunk written
|
||||
to the stream will be immediately emitted.
|
||||
- `emittedEnd` Read-only. Boolean indicating whether the end-ish
|
||||
events (ie, `end`, `prefinish`, `finish`) have been emitted.
|
||||
Note that listening on any end-ish event will immediateyl
|
||||
re-emit it if it has already been emitted.
|
||||
- `writable` Whether the stream is writable. Default `true`. Set
|
||||
to `false` when `end()`
|
||||
- `readable` Whether the stream is readable. Default `true`.
|
||||
- `pipes` An array of Pipe objects referencing streams that this
|
||||
stream is piping into.
|
||||
- `destroyed` A getter that indicates whether the stream was
|
||||
destroyed.
|
||||
- `paused` True if the stream has been explicitly paused,
|
||||
otherwise false.
|
||||
- `objectMode` Indicates whether the stream is in `objectMode`.
|
||||
- `aborted` Readonly property set when the `AbortSignal`
|
||||
dispatches an `abort` event.
|
||||
|
||||
### Events
|
||||
|
||||
- `data` Emitted when there's data to read. Argument is the data
|
||||
to read. This is never emitted while not flowing. If a listener
|
||||
is attached, that will resume the stream.
|
||||
- `end` Emitted when there's no more data to read. This will be
|
||||
emitted immediately for empty streams when `end()` is called.
|
||||
If a listener is attached, and `end` was already emitted, then
|
||||
it will be emitted again. All listeners are removed when `end`
|
||||
is emitted.
|
||||
- `prefinish` An end-ish event that follows the same logic as
|
||||
`end` and is emitted in the same conditions where `end` is
|
||||
emitted. Emitted after `'end'`.
|
||||
- `finish` An end-ish event that follows the same logic as `end`
|
||||
and is emitted in the same conditions where `end` is emitted.
|
||||
Emitted after `'prefinish'`.
|
||||
- `close` An indication that an underlying resource has been
|
||||
released. Minipass does not emit this event, but will defer it
|
||||
until after `end` has been emitted, since it throws off some
|
||||
stream libraries otherwise.
|
||||
- `drain` Emitted when the internal buffer empties, and it is
|
||||
again suitable to `write()` into the stream.
|
||||
- `readable` Emitted when data is buffered and ready to be read
|
||||
by a consumer.
|
||||
- `resume` Emitted when stream changes state from buffering to
|
||||
flowing mode. (Ie, when `resume` is called, `pipe` is called,
|
||||
or a `data` event listener is added.)
|
||||
|
||||
### Static Methods
|
||||
|
||||
- `Minipass.isStream(stream)` Returns `true` if the argument is a
|
||||
stream, and false otherwise. To be considered a stream, the
|
||||
object must be either an instance of Minipass, or an
|
||||
EventEmitter that has either a `pipe()` method, or both
|
||||
`write()` and `end()` methods. (Pretty much any stream in
|
||||
node-land will return `true` for this.)
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
Here are some examples of things you can do with Minipass
|
||||
streams.
|
||||
|
||||
### simple "are you done yet" promise
|
||||
|
||||
```js
|
||||
mp.promise().then(
|
||||
() => {
|
||||
// stream is finished
|
||||
},
|
||||
er => {
|
||||
// stream emitted an error
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
### collecting
|
||||
|
||||
```js
|
||||
mp.collect().then(all => {
|
||||
// all is an array of all the data emitted
|
||||
// encoding is supported in this case, so
|
||||
// so the result will be a collection of strings if
|
||||
// an encoding is specified, or buffers/objects if not.
|
||||
//
|
||||
// In an async function, you may do
|
||||
// const data = await stream.collect()
|
||||
})
|
||||
```
|
||||
|
||||
### collecting into a single blob
|
||||
|
||||
This is a bit slower because it concatenates the data into one
|
||||
chunk for you, but if you're going to do it yourself anyway, it's
|
||||
convenient this way:
|
||||
|
||||
```js
|
||||
mp.concat().then(onebigchunk => {
|
||||
// onebigchunk is a string if the stream
|
||||
// had an encoding set, or a buffer otherwise.
|
||||
})
|
||||
```
|
||||
|
||||
### iteration
|
||||
|
||||
You can iterate over streams synchronously or asynchronously in
|
||||
platforms that support it.
|
||||
|
||||
Synchronous iteration will end when the currently available data
|
||||
is consumed, even if the `end` event has not been reached. In
|
||||
string and buffer mode, the data is concatenated, so unless
|
||||
multiple writes are occurring in the same tick as the `read()`,
|
||||
sync iteration loops will generally only have a single iteration.
|
||||
|
||||
To consume chunks in this way exactly as they have been written,
|
||||
with no flattening, create the stream with the `{ objectMode:
|
||||
true }` option.
|
||||
|
||||
```js
|
||||
const mp = new Minipass({ objectMode: true })
|
||||
mp.write('a')
|
||||
mp.write('b')
|
||||
for (let letter of mp) {
|
||||
console.log(letter) // a, b
|
||||
}
|
||||
mp.write('c')
|
||||
mp.write('d')
|
||||
for (let letter of mp) {
|
||||
console.log(letter) // c, d
|
||||
}
|
||||
mp.write('e')
|
||||
mp.end()
|
||||
for (let letter of mp) {
|
||||
console.log(letter) // e
|
||||
}
|
||||
for (let letter of mp) {
|
||||
console.log(letter) // nothing
|
||||
}
|
||||
```
|
||||
|
||||
Asynchronous iteration will continue until the end event is reached,
|
||||
consuming all of the data.
|
||||
|
||||
```js
|
||||
const mp = new Minipass({ encoding: 'utf8' })
|
||||
|
||||
// some source of some data
|
||||
let i = 5
|
||||
const inter = setInterval(() => {
|
||||
if (i-- > 0) mp.write(Buffer.from('foo\n', 'utf8'))
|
||||
else {
|
||||
mp.end()
|
||||
clearInterval(inter)
|
||||
}
|
||||
}, 100)
|
||||
|
||||
// consume the data with asynchronous iteration
|
||||
async function consume() {
|
||||
for await (let chunk of mp) {
|
||||
console.log(chunk)
|
||||
}
|
||||
return 'ok'
|
||||
}
|
||||
|
||||
consume().then(res => console.log(res))
|
||||
// logs `foo\n` 5 times, and then `ok`
|
||||
```
|
||||
|
||||
### subclass that `console.log()`s everything written into it
|
||||
|
||||
```js
|
||||
class Logger extends Minipass {
|
||||
write(chunk, encoding, callback) {
|
||||
console.log('WRITE', chunk, encoding)
|
||||
return super.write(chunk, encoding, callback)
|
||||
}
|
||||
end(chunk, encoding, callback) {
|
||||
console.log('END', chunk, encoding)
|
||||
return super.end(chunk, encoding, callback)
|
||||
}
|
||||
}
|
||||
|
||||
someSource.pipe(new Logger()).pipe(someDest)
|
||||
```
|
||||
|
||||
### same thing, but using an inline anonymous class
|
||||
|
||||
```js
|
||||
// js classes are fun
|
||||
someSource
|
||||
.pipe(
|
||||
new (class extends Minipass {
|
||||
emit(ev, ...data) {
|
||||
// let's also log events, because debugging some weird thing
|
||||
console.log('EMIT', ev)
|
||||
return super.emit(ev, ...data)
|
||||
}
|
||||
write(chunk, encoding, callback) {
|
||||
console.log('WRITE', chunk, encoding)
|
||||
return super.write(chunk, encoding, callback)
|
||||
}
|
||||
end(chunk, encoding, callback) {
|
||||
console.log('END', chunk, encoding)
|
||||
return super.end(chunk, encoding, callback)
|
||||
}
|
||||
})()
|
||||
)
|
||||
.pipe(someDest)
|
||||
```
|
||||
|
||||
### subclass that defers 'end' for some reason
|
||||
|
||||
```js
|
||||
class SlowEnd extends Minipass {
|
||||
emit(ev, ...args) {
|
||||
if (ev === 'end') {
|
||||
console.log('going to end, hold on a sec')
|
||||
setTimeout(() => {
|
||||
console.log('ok, ready to end now')
|
||||
super.emit('end', ...args)
|
||||
}, 100)
|
||||
return true
|
||||
} else {
|
||||
return super.emit(ev, ...args)
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### transform that creates newline-delimited JSON
|
||||
|
||||
```js
|
||||
class NDJSONEncode extends Minipass {
|
||||
write(obj, cb) {
|
||||
try {
|
||||
// JSON.stringify can throw, emit an error on that
|
||||
return super.write(JSON.stringify(obj) + '\n', 'utf8', cb)
|
||||
} catch (er) {
|
||||
this.emit('error', er)
|
||||
}
|
||||
}
|
||||
end(obj, cb) {
|
||||
if (typeof obj === 'function') {
|
||||
cb = obj
|
||||
obj = undefined
|
||||
}
|
||||
if (obj !== undefined) {
|
||||
this.write(obj)
|
||||
}
|
||||
return super.end(cb)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### transform that parses newline-delimited JSON
|
||||
|
||||
```js
|
||||
class NDJSONDecode extends Minipass {
|
||||
constructor(options) {
|
||||
// always be in object mode, as far as Minipass is concerned
|
||||
super({ objectMode: true })
|
||||
this._jsonBuffer = ''
|
||||
}
|
||||
write(chunk, encoding, cb) {
|
||||
if (
|
||||
typeof chunk === 'string' &&
|
||||
typeof encoding === 'string' &&
|
||||
encoding !== 'utf8'
|
||||
) {
|
||||
chunk = Buffer.from(chunk, encoding).toString()
|
||||
} else if (Buffer.isBuffer(chunk)) {
|
||||
chunk = chunk.toString()
|
||||
}
|
||||
if (typeof encoding === 'function') {
|
||||
cb = encoding
|
||||
}
|
||||
const jsonData = (this._jsonBuffer + chunk).split('\n')
|
||||
this._jsonBuffer = jsonData.pop()
|
||||
for (let i = 0; i < jsonData.length; i++) {
|
||||
try {
|
||||
// JSON.parse can throw, emit an error on that
|
||||
super.write(JSON.parse(jsonData[i]))
|
||||
} catch (er) {
|
||||
this.emit('error', er)
|
||||
continue
|
||||
}
|
||||
}
|
||||
if (cb) cb()
|
||||
}
|
||||
}
|
||||
```
|
||||
545
electron/node_modules/rimraf/node_modules/minipass/dist/commonjs/index.d.ts
generated
vendored
545
electron/node_modules/rimraf/node_modules/minipass/dist/commonjs/index.d.ts
generated
vendored
|
|
@ -1,545 +0,0 @@
|
|||
import { EventEmitter } from 'node:events';
|
||||
import { StringDecoder } from 'node:string_decoder';
|
||||
/**
|
||||
* Same as StringDecoder, but exposing the `lastNeed` flag on the type
|
||||
*/
|
||||
type SD = StringDecoder & {
|
||||
lastNeed: boolean;
|
||||
};
|
||||
export type { SD, Pipe, PipeProxyErrors };
|
||||
/**
|
||||
* Return true if the argument is a Minipass stream, Node stream, or something
|
||||
* else that Minipass can interact with.
|
||||
*/
|
||||
export declare const isStream: (s: any) => s is Minipass<any, any, any> | NodeJS.ReadStream | NodeJS.WriteStream | (EventEmitter<any> & {
|
||||
end(): any;
|
||||
write(chunk: any, ...args: any[]): any;
|
||||
}) | (EventEmitter<any> & {
|
||||
pause(): any;
|
||||
resume(): any;
|
||||
pipe(...destArgs: any[]): any;
|
||||
}) | (NodeJS.ReadStream & {
|
||||
fd: number;
|
||||
}) | (NodeJS.WriteStream & {
|
||||
fd: number;
|
||||
});
|
||||
/**
|
||||
* Return true if the argument is a valid {@link Minipass.Readable}
|
||||
*/
|
||||
export declare const isReadable: (s: any) => s is Minipass.Readable;
|
||||
/**
|
||||
* Return true if the argument is a valid {@link Minipass.Writable}
|
||||
*/
|
||||
export declare const isWritable: (s: any) => s is Minipass.Readable;
|
||||
declare const EOF: unique symbol;
|
||||
declare const MAYBE_EMIT_END: unique symbol;
|
||||
declare const EMITTED_END: unique symbol;
|
||||
declare const EMITTING_END: unique symbol;
|
||||
declare const EMITTED_ERROR: unique symbol;
|
||||
declare const CLOSED: unique symbol;
|
||||
declare const READ: unique symbol;
|
||||
declare const FLUSH: unique symbol;
|
||||
declare const FLUSHCHUNK: unique symbol;
|
||||
declare const ENCODING: unique symbol;
|
||||
declare const DECODER: unique symbol;
|
||||
declare const FLOWING: unique symbol;
|
||||
declare const PAUSED: unique symbol;
|
||||
declare const RESUME: unique symbol;
|
||||
declare const BUFFER: unique symbol;
|
||||
declare const PIPES: unique symbol;
|
||||
declare const BUFFERLENGTH: unique symbol;
|
||||
declare const BUFFERPUSH: unique symbol;
|
||||
declare const BUFFERSHIFT: unique symbol;
|
||||
declare const OBJECTMODE: unique symbol;
|
||||
declare const DESTROYED: unique symbol;
|
||||
declare const ERROR: unique symbol;
|
||||
declare const EMITDATA: unique symbol;
|
||||
declare const EMITEND: unique symbol;
|
||||
declare const EMITEND2: unique symbol;
|
||||
declare const ASYNC: unique symbol;
|
||||
declare const ABORT: unique symbol;
|
||||
declare const ABORTED: unique symbol;
|
||||
declare const SIGNAL: unique symbol;
|
||||
declare const DATALISTENERS: unique symbol;
|
||||
declare const DISCARDED: unique symbol;
|
||||
/**
|
||||
* Options that may be passed to stream.pipe()
|
||||
*/
|
||||
export interface PipeOptions {
|
||||
/**
|
||||
* end the destination stream when the source stream ends
|
||||
*/
|
||||
end?: boolean;
|
||||
/**
|
||||
* proxy errors from the source stream to the destination stream
|
||||
*/
|
||||
proxyErrors?: boolean;
|
||||
}
|
||||
/**
|
||||
* Internal class representing a pipe to a destination stream.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
declare class Pipe<T extends unknown> {
|
||||
src: Minipass<T>;
|
||||
dest: Minipass<any, T>;
|
||||
opts: PipeOptions;
|
||||
ondrain: () => any;
|
||||
constructor(src: Minipass<T>, dest: Minipass.Writable, opts: PipeOptions);
|
||||
unpipe(): void;
|
||||
proxyErrors(_er: any): void;
|
||||
end(): void;
|
||||
}
|
||||
/**
|
||||
* Internal class representing a pipe to a destination stream where
|
||||
* errors are proxied.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
declare class PipeProxyErrors<T> extends Pipe<T> {
|
||||
unpipe(): void;
|
||||
constructor(src: Minipass<T>, dest: Minipass.Writable, opts: PipeOptions);
|
||||
}
|
||||
export declare namespace Minipass {
|
||||
/**
|
||||
* Encoding used to create a stream that outputs strings rather than
|
||||
* Buffer objects.
|
||||
*/
|
||||
export type Encoding = BufferEncoding | 'buffer' | null;
|
||||
/**
|
||||
* Any stream that Minipass can pipe into
|
||||
*/
|
||||
export type Writable = Minipass<any, any, any> | NodeJS.WriteStream | (NodeJS.WriteStream & {
|
||||
fd: number;
|
||||
}) | (EventEmitter & {
|
||||
end(): any;
|
||||
write(chunk: any, ...args: any[]): any;
|
||||
});
|
||||
/**
|
||||
* Any stream that can be read from
|
||||
*/
|
||||
export type Readable = Minipass<any, any, any> | NodeJS.ReadStream | (NodeJS.ReadStream & {
|
||||
fd: number;
|
||||
}) | (EventEmitter & {
|
||||
pause(): any;
|
||||
resume(): any;
|
||||
pipe(...destArgs: any[]): any;
|
||||
});
|
||||
/**
|
||||
* Utility type that can be iterated sync or async
|
||||
*/
|
||||
export type DualIterable<T> = Iterable<T> & AsyncIterable<T>;
|
||||
type EventArguments = Record<string | symbol, unknown[]>;
|
||||
/**
|
||||
* The listing of events that a Minipass class can emit.
|
||||
* Extend this when extending the Minipass class, and pass as
|
||||
* the third template argument. The key is the name of the event,
|
||||
* and the value is the argument list.
|
||||
*
|
||||
* Any undeclared events will still be allowed, but the handler will get
|
||||
* arguments as `unknown[]`.
|
||||
*/
|
||||
export interface Events<RType extends any = Buffer> extends EventArguments {
|
||||
readable: [];
|
||||
data: [chunk: RType];
|
||||
error: [er: unknown];
|
||||
abort: [reason: unknown];
|
||||
drain: [];
|
||||
resume: [];
|
||||
end: [];
|
||||
finish: [];
|
||||
prefinish: [];
|
||||
close: [];
|
||||
[DESTROYED]: [er?: unknown];
|
||||
[ERROR]: [er: unknown];
|
||||
}
|
||||
/**
|
||||
* String or buffer-like data that can be joined and sliced
|
||||
*/
|
||||
export type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string;
|
||||
export type BufferOrString = Buffer | string;
|
||||
/**
|
||||
* Options passed to the Minipass constructor.
|
||||
*/
|
||||
export type SharedOptions = {
|
||||
/**
|
||||
* Defer all data emission and other events until the end of the
|
||||
* current tick, similar to Node core streams
|
||||
*/
|
||||
async?: boolean;
|
||||
/**
|
||||
* A signal which will abort the stream
|
||||
*/
|
||||
signal?: AbortSignal;
|
||||
/**
|
||||
* Output string encoding. Set to `null` or `'buffer'` (or omit) to
|
||||
* emit Buffer objects rather than strings.
|
||||
*
|
||||
* Conflicts with `objectMode`
|
||||
*/
|
||||
encoding?: BufferEncoding | null | 'buffer';
|
||||
/**
|
||||
* Output data exactly as it was written, supporting non-buffer/string
|
||||
* data (such as arbitrary objects, falsey values, etc.)
|
||||
*
|
||||
* Conflicts with `encoding`
|
||||
*/
|
||||
objectMode?: boolean;
|
||||
};
|
||||
/**
|
||||
* Options for a string encoded output
|
||||
*/
|
||||
export type EncodingOptions = SharedOptions & {
|
||||
encoding: BufferEncoding;
|
||||
objectMode?: false;
|
||||
};
|
||||
/**
|
||||
* Options for contiguous data buffer output
|
||||
*/
|
||||
export type BufferOptions = SharedOptions & {
|
||||
encoding?: null | 'buffer';
|
||||
objectMode?: false;
|
||||
};
|
||||
/**
|
||||
* Options for objectMode arbitrary output
|
||||
*/
|
||||
export type ObjectModeOptions = SharedOptions & {
|
||||
objectMode: true;
|
||||
encoding?: null;
|
||||
};
|
||||
/**
|
||||
* Utility type to determine allowed options based on read type
|
||||
*/
|
||||
export type Options<T> = ObjectModeOptions | (T extends string ? EncodingOptions : T extends Buffer ? BufferOptions : SharedOptions);
|
||||
export {};
|
||||
}
|
||||
/**
|
||||
* Main export, the Minipass class
|
||||
*
|
||||
* `RType` is the type of data emitted, defaults to Buffer
|
||||
*
|
||||
* `WType` is the type of data to be written, if RType is buffer or string,
|
||||
* then any {@link Minipass.ContiguousData} is allowed.
|
||||
*
|
||||
* `Events` is the set of event handler signatures that this object
|
||||
* will emit, see {@link Minipass.Events}
|
||||
*/
|
||||
export declare class Minipass<RType extends unknown = Buffer, WType extends unknown = RType extends Minipass.BufferOrString ? Minipass.ContiguousData : RType, Events extends Minipass.Events<RType> = Minipass.Events<RType>> extends EventEmitter implements Minipass.DualIterable<RType> {
|
||||
[FLOWING]: boolean;
|
||||
[PAUSED]: boolean;
|
||||
[PIPES]: Pipe<RType>[];
|
||||
[BUFFER]: RType[];
|
||||
[OBJECTMODE]: boolean;
|
||||
[ENCODING]: BufferEncoding | null;
|
||||
[ASYNC]: boolean;
|
||||
[DECODER]: SD | null;
|
||||
[EOF]: boolean;
|
||||
[EMITTED_END]: boolean;
|
||||
[EMITTING_END]: boolean;
|
||||
[CLOSED]: boolean;
|
||||
[EMITTED_ERROR]: unknown;
|
||||
[BUFFERLENGTH]: number;
|
||||
[DESTROYED]: boolean;
|
||||
[SIGNAL]?: AbortSignal;
|
||||
[ABORTED]: boolean;
|
||||
[DATALISTENERS]: number;
|
||||
[DISCARDED]: boolean;
|
||||
/**
|
||||
* true if the stream can be written
|
||||
*/
|
||||
writable: boolean;
|
||||
/**
|
||||
* true if the stream can be read
|
||||
*/
|
||||
readable: boolean;
|
||||
/**
|
||||
* If `RType` is Buffer, then options do not need to be provided.
|
||||
* Otherwise, an options object must be provided to specify either
|
||||
* {@link Minipass.SharedOptions.objectMode} or
|
||||
* {@link Minipass.SharedOptions.encoding}, as appropriate.
|
||||
*/
|
||||
constructor(...args: [Minipass.ObjectModeOptions] | (RType extends Buffer ? [] | [Minipass.Options<RType>] : [Minipass.Options<RType>]));
|
||||
/**
|
||||
* The amount of data stored in the buffer waiting to be read.
|
||||
*
|
||||
* For Buffer strings, this will be the total byte length.
|
||||
* For string encoding streams, this will be the string character length,
|
||||
* according to JavaScript's `string.length` logic.
|
||||
* For objectMode streams, this is a count of the items waiting to be
|
||||
* emitted.
|
||||
*/
|
||||
get bufferLength(): number;
|
||||
/**
|
||||
* The `BufferEncoding` currently in use, or `null`
|
||||
*/
|
||||
get encoding(): BufferEncoding | null;
|
||||
/**
|
||||
* @deprecated - This is a read only property
|
||||
*/
|
||||
set encoding(_enc: BufferEncoding | null);
|
||||
/**
|
||||
* @deprecated - Encoding may only be set at instantiation time
|
||||
*/
|
||||
setEncoding(_enc: Minipass.Encoding): void;
|
||||
/**
|
||||
* True if this is an objectMode stream
|
||||
*/
|
||||
get objectMode(): boolean;
|
||||
/**
|
||||
* @deprecated - This is a read-only property
|
||||
*/
|
||||
set objectMode(_om: boolean);
|
||||
/**
|
||||
* true if this is an async stream
|
||||
*/
|
||||
get ['async'](): boolean;
|
||||
/**
|
||||
* Set to true to make this stream async.
|
||||
*
|
||||
* Once set, it cannot be unset, as this would potentially cause incorrect
|
||||
* behavior. Ie, a sync stream can be made async, but an async stream
|
||||
* cannot be safely made sync.
|
||||
*/
|
||||
set ['async'](a: boolean);
|
||||
[ABORT](): void;
|
||||
/**
|
||||
* True if the stream has been aborted.
|
||||
*/
|
||||
get aborted(): boolean;
|
||||
/**
|
||||
* No-op setter. Stream aborted status is set via the AbortSignal provided
|
||||
* in the constructor options.
|
||||
*/
|
||||
set aborted(_: boolean);
|
||||
/**
|
||||
* Write data into the stream
|
||||
*
|
||||
* If the chunk written is a string, and encoding is not specified, then
|
||||
* `utf8` will be assumed. If the stream encoding matches the encoding of
|
||||
* a written string, and the state of the string decoder allows it, then
|
||||
* the string will be passed through to either the output or the internal
|
||||
* buffer without any processing. Otherwise, it will be turned into a
|
||||
* Buffer object for processing into the desired encoding.
|
||||
*
|
||||
* If provided, `cb` function is called immediately before return for
|
||||
* sync streams, or on next tick for async streams, because for this
|
||||
* base class, a chunk is considered "processed" once it is accepted
|
||||
* and either emitted or buffered. That is, the callback does not indicate
|
||||
* that the chunk has been eventually emitted, though of course child
|
||||
* classes can override this function to do whatever processing is required
|
||||
* and call `super.write(...)` only once processing is completed.
|
||||
*/
|
||||
write(chunk: WType, cb?: () => void): boolean;
|
||||
write(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): boolean;
|
||||
/**
|
||||
* Low-level explicit read method.
|
||||
*
|
||||
* In objectMode, the argument is ignored, and one item is returned if
|
||||
* available.
|
||||
*
|
||||
* `n` is the number of bytes (or in the case of encoding streams,
|
||||
* characters) to consume. If `n` is not provided, then the entire buffer
|
||||
* is returned, or `null` is returned if no data is available.
|
||||
*
|
||||
* If `n` is greater that the amount of data in the internal buffer,
|
||||
* then `null` is returned.
|
||||
*/
|
||||
read(n?: number | null): RType | null;
|
||||
[READ](n: number | null, chunk: RType): RType;
|
||||
/**
|
||||
* End the stream, optionally providing a final write.
|
||||
*
|
||||
* See {@link Minipass#write} for argument descriptions
|
||||
*/
|
||||
end(cb?: () => void): this;
|
||||
end(chunk: WType, cb?: () => void): this;
|
||||
end(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): this;
|
||||
[RESUME](): void;
|
||||
/**
|
||||
* Resume the stream if it is currently in a paused state
|
||||
*
|
||||
* If called when there are no pipe destinations or `data` event listeners,
|
||||
* this will place the stream in a "discarded" state, where all data will
|
||||
* be thrown away. The discarded state is removed if a pipe destination or
|
||||
* data handler is added, if pause() is called, or if any synchronous or
|
||||
* asynchronous iteration is started.
|
||||
*/
|
||||
resume(): void;
|
||||
/**
|
||||
* Pause the stream
|
||||
*/
|
||||
pause(): void;
|
||||
/**
|
||||
* true if the stream has been forcibly destroyed
|
||||
*/
|
||||
get destroyed(): boolean;
|
||||
/**
|
||||
* true if the stream is currently in a flowing state, meaning that
|
||||
* any writes will be immediately emitted.
|
||||
*/
|
||||
get flowing(): boolean;
|
||||
/**
|
||||
* true if the stream is currently in a paused state
|
||||
*/
|
||||
get paused(): boolean;
|
||||
[BUFFERPUSH](chunk: RType): void;
|
||||
[BUFFERSHIFT](): RType;
|
||||
[FLUSH](noDrain?: boolean): void;
|
||||
[FLUSHCHUNK](chunk: RType): boolean;
|
||||
/**
|
||||
* Pipe all data emitted by this stream into the destination provided.
|
||||
*
|
||||
* Triggers the flow of data.
|
||||
*/
|
||||
pipe<W extends Minipass.Writable>(dest: W, opts?: PipeOptions): W;
|
||||
/**
|
||||
* Fully unhook a piped destination stream.
|
||||
*
|
||||
* If the destination stream was the only consumer of this stream (ie,
|
||||
* there are no other piped destinations or `'data'` event listeners)
|
||||
* then the flow of data will stop until there is another consumer or
|
||||
* {@link Minipass#resume} is explicitly called.
|
||||
*/
|
||||
unpipe<W extends Minipass.Writable>(dest: W): void;
|
||||
/**
|
||||
* Alias for {@link Minipass#on}
|
||||
*/
|
||||
addListener<Event extends keyof Events>(ev: Event, handler: (...args: Events[Event]) => any): this;
|
||||
/**
|
||||
* Mostly identical to `EventEmitter.on`, with the following
|
||||
* behavior differences to prevent data loss and unnecessary hangs:
|
||||
*
|
||||
* - Adding a 'data' event handler will trigger the flow of data
|
||||
*
|
||||
* - Adding a 'readable' event handler when there is data waiting to be read
|
||||
* will cause 'readable' to be emitted immediately.
|
||||
*
|
||||
* - Adding an 'endish' event handler ('end', 'finish', etc.) which has
|
||||
* already passed will cause the event to be emitted immediately and all
|
||||
* handlers removed.
|
||||
*
|
||||
* - Adding an 'error' event handler after an error has been emitted will
|
||||
* cause the event to be re-emitted immediately with the error previously
|
||||
* raised.
|
||||
*/
|
||||
on<Event extends keyof Events>(ev: Event, handler: (...args: Events[Event]) => any): this;
|
||||
/**
|
||||
* Alias for {@link Minipass#off}
|
||||
*/
|
||||
removeListener<Event extends keyof Events>(ev: Event, handler: (...args: Events[Event]) => any): this;
|
||||
/**
|
||||
* Mostly identical to `EventEmitter.off`
|
||||
*
|
||||
* If a 'data' event handler is removed, and it was the last consumer
|
||||
* (ie, there are no pipe destinations or other 'data' event listeners),
|
||||
* then the flow of data will stop until there is another consumer or
|
||||
* {@link Minipass#resume} is explicitly called.
|
||||
*/
|
||||
off<Event extends keyof Events>(ev: Event, handler: (...args: Events[Event]) => any): this;
|
||||
/**
|
||||
* Mostly identical to `EventEmitter.removeAllListeners`
|
||||
*
|
||||
* If all 'data' event handlers are removed, and they were the last consumer
|
||||
* (ie, there are no pipe destinations), then the flow of data will stop
|
||||
* until there is another consumer or {@link Minipass#resume} is explicitly
|
||||
* called.
|
||||
*/
|
||||
removeAllListeners<Event extends keyof Events>(ev?: Event): this;
|
||||
/**
|
||||
* true if the 'end' event has been emitted
|
||||
*/
|
||||
get emittedEnd(): boolean;
|
||||
[MAYBE_EMIT_END](): void;
|
||||
/**
|
||||
* Mostly identical to `EventEmitter.emit`, with the following
|
||||
* behavior differences to prevent data loss and unnecessary hangs:
|
||||
*
|
||||
* If the stream has been destroyed, and the event is something other
|
||||
* than 'close' or 'error', then `false` is returned and no handlers
|
||||
* are called.
|
||||
*
|
||||
* If the event is 'end', and has already been emitted, then the event
|
||||
* is ignored. If the stream is in a paused or non-flowing state, then
|
||||
* the event will be deferred until data flow resumes. If the stream is
|
||||
* async, then handlers will be called on the next tick rather than
|
||||
* immediately.
|
||||
*
|
||||
* If the event is 'close', and 'end' has not yet been emitted, then
|
||||
* the event will be deferred until after 'end' is emitted.
|
||||
*
|
||||
* If the event is 'error', and an AbortSignal was provided for the stream,
|
||||
* and there are no listeners, then the event is ignored, matching the
|
||||
* behavior of node core streams in the presense of an AbortSignal.
|
||||
*
|
||||
* If the event is 'finish' or 'prefinish', then all listeners will be
|
||||
* removed after emitting the event, to prevent double-firing.
|
||||
*/
|
||||
emit<Event extends keyof Events>(ev: Event, ...args: Events[Event]): boolean;
|
||||
[EMITDATA](data: RType): boolean;
|
||||
[EMITEND](): boolean;
|
||||
[EMITEND2](): boolean;
|
||||
/**
|
||||
* Return a Promise that resolves to an array of all emitted data once
|
||||
* the stream ends.
|
||||
*/
|
||||
collect(): Promise<RType[] & {
|
||||
dataLength: number;
|
||||
}>;
|
||||
/**
|
||||
* Return a Promise that resolves to the concatenation of all emitted data
|
||||
* once the stream ends.
|
||||
*
|
||||
* Not allowed on objectMode streams.
|
||||
*/
|
||||
concat(): Promise<RType>;
|
||||
/**
|
||||
* Return a void Promise that resolves once the stream ends.
|
||||
*/
|
||||
promise(): Promise<void>;
|
||||
/**
|
||||
* Asynchronous `for await of` iteration.
|
||||
*
|
||||
* This will continue emitting all chunks until the stream terminates.
|
||||
*/
|
||||
[Symbol.asyncIterator](): AsyncGenerator<RType, void, void>;
|
||||
/**
|
||||
* Synchronous `for of` iteration.
|
||||
*
|
||||
* The iteration will terminate when the internal buffer runs out, even
|
||||
* if the stream has not yet terminated.
|
||||
*/
|
||||
[Symbol.iterator](): Generator<RType, void, void>;
|
||||
/**
|
||||
* Destroy a stream, preventing it from being used for any further purpose.
|
||||
*
|
||||
* If the stream has a `close()` method, then it will be called on
|
||||
* destruction.
|
||||
*
|
||||
* After destruction, any attempt to write data, read data, or emit most
|
||||
* events will be ignored.
|
||||
*
|
||||
* If an error argument is provided, then it will be emitted in an
|
||||
* 'error' event.
|
||||
*/
|
||||
destroy(er?: unknown): this;
|
||||
/**
|
||||
* Alias for {@link isStream}
|
||||
*
|
||||
* Former export location, maintained for backwards compatibility.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
static get isStream(): (s: any) => s is Minipass<any, any, any> | NodeJS.ReadStream | NodeJS.WriteStream | (EventEmitter<any> & {
|
||||
end(): any;
|
||||
write(chunk: any, ...args: any[]): any;
|
||||
}) | (EventEmitter<any> & {
|
||||
pause(): any;
|
||||
resume(): any;
|
||||
pipe(...destArgs: any[]): any;
|
||||
}) | (NodeJS.ReadStream & {
|
||||
fd: number;
|
||||
}) | (NodeJS.WriteStream & {
|
||||
fd: number;
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
electron/node_modules/rimraf/node_modules/minipass/dist/commonjs/index.d.ts.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/minipass/dist/commonjs/index.d.ts.map
generated
vendored
File diff suppressed because one or more lines are too long
1038
electron/node_modules/rimraf/node_modules/minipass/dist/commonjs/index.js
generated
vendored
1038
electron/node_modules/rimraf/node_modules/minipass/dist/commonjs/index.js
generated
vendored
File diff suppressed because it is too large
Load diff
1
electron/node_modules/rimraf/node_modules/minipass/dist/commonjs/index.js.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/minipass/dist/commonjs/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
3
electron/node_modules/rimraf/node_modules/minipass/dist/commonjs/package.json
generated
vendored
3
electron/node_modules/rimraf/node_modules/minipass/dist/commonjs/package.json
generated
vendored
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"type": "commonjs"
|
||||
}
|
||||
545
electron/node_modules/rimraf/node_modules/minipass/dist/esm/index.d.ts
generated
vendored
545
electron/node_modules/rimraf/node_modules/minipass/dist/esm/index.d.ts
generated
vendored
|
|
@ -1,545 +0,0 @@
|
|||
import { EventEmitter } from 'node:events';
|
||||
import { StringDecoder } from 'node:string_decoder';
|
||||
/**
|
||||
* Same as StringDecoder, but exposing the `lastNeed` flag on the type
|
||||
*/
|
||||
type SD = StringDecoder & {
|
||||
lastNeed: boolean;
|
||||
};
|
||||
export type { SD, Pipe, PipeProxyErrors };
|
||||
/**
|
||||
* Return true if the argument is a Minipass stream, Node stream, or something
|
||||
* else that Minipass can interact with.
|
||||
*/
|
||||
export declare const isStream: (s: any) => s is Minipass<any, any, any> | NodeJS.ReadStream | NodeJS.WriteStream | (EventEmitter<any> & {
|
||||
end(): any;
|
||||
write(chunk: any, ...args: any[]): any;
|
||||
}) | (EventEmitter<any> & {
|
||||
pause(): any;
|
||||
resume(): any;
|
||||
pipe(...destArgs: any[]): any;
|
||||
}) | (NodeJS.ReadStream & {
|
||||
fd: number;
|
||||
}) | (NodeJS.WriteStream & {
|
||||
fd: number;
|
||||
});
|
||||
/**
|
||||
* Return true if the argument is a valid {@link Minipass.Readable}
|
||||
*/
|
||||
export declare const isReadable: (s: any) => s is Minipass.Readable;
|
||||
/**
|
||||
* Return true if the argument is a valid {@link Minipass.Writable}
|
||||
*/
|
||||
export declare const isWritable: (s: any) => s is Minipass.Readable;
|
||||
declare const EOF: unique symbol;
|
||||
declare const MAYBE_EMIT_END: unique symbol;
|
||||
declare const EMITTED_END: unique symbol;
|
||||
declare const EMITTING_END: unique symbol;
|
||||
declare const EMITTED_ERROR: unique symbol;
|
||||
declare const CLOSED: unique symbol;
|
||||
declare const READ: unique symbol;
|
||||
declare const FLUSH: unique symbol;
|
||||
declare const FLUSHCHUNK: unique symbol;
|
||||
declare const ENCODING: unique symbol;
|
||||
declare const DECODER: unique symbol;
|
||||
declare const FLOWING: unique symbol;
|
||||
declare const PAUSED: unique symbol;
|
||||
declare const RESUME: unique symbol;
|
||||
declare const BUFFER: unique symbol;
|
||||
declare const PIPES: unique symbol;
|
||||
declare const BUFFERLENGTH: unique symbol;
|
||||
declare const BUFFERPUSH: unique symbol;
|
||||
declare const BUFFERSHIFT: unique symbol;
|
||||
declare const OBJECTMODE: unique symbol;
|
||||
declare const DESTROYED: unique symbol;
|
||||
declare const ERROR: unique symbol;
|
||||
declare const EMITDATA: unique symbol;
|
||||
declare const EMITEND: unique symbol;
|
||||
declare const EMITEND2: unique symbol;
|
||||
declare const ASYNC: unique symbol;
|
||||
declare const ABORT: unique symbol;
|
||||
declare const ABORTED: unique symbol;
|
||||
declare const SIGNAL: unique symbol;
|
||||
declare const DATALISTENERS: unique symbol;
|
||||
declare const DISCARDED: unique symbol;
|
||||
/**
|
||||
* Options that may be passed to stream.pipe()
|
||||
*/
|
||||
export interface PipeOptions {
|
||||
/**
|
||||
* end the destination stream when the source stream ends
|
||||
*/
|
||||
end?: boolean;
|
||||
/**
|
||||
* proxy errors from the source stream to the destination stream
|
||||
*/
|
||||
proxyErrors?: boolean;
|
||||
}
|
||||
/**
|
||||
* Internal class representing a pipe to a destination stream.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
declare class Pipe<T extends unknown> {
|
||||
src: Minipass<T>;
|
||||
dest: Minipass<any, T>;
|
||||
opts: PipeOptions;
|
||||
ondrain: () => any;
|
||||
constructor(src: Minipass<T>, dest: Minipass.Writable, opts: PipeOptions);
|
||||
unpipe(): void;
|
||||
proxyErrors(_er: any): void;
|
||||
end(): void;
|
||||
}
|
||||
/**
|
||||
* Internal class representing a pipe to a destination stream where
|
||||
* errors are proxied.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
declare class PipeProxyErrors<T> extends Pipe<T> {
|
||||
unpipe(): void;
|
||||
constructor(src: Minipass<T>, dest: Minipass.Writable, opts: PipeOptions);
|
||||
}
|
||||
export declare namespace Minipass {
|
||||
/**
|
||||
* Encoding used to create a stream that outputs strings rather than
|
||||
* Buffer objects.
|
||||
*/
|
||||
export type Encoding = BufferEncoding | 'buffer' | null;
|
||||
/**
|
||||
* Any stream that Minipass can pipe into
|
||||
*/
|
||||
export type Writable = Minipass<any, any, any> | NodeJS.WriteStream | (NodeJS.WriteStream & {
|
||||
fd: number;
|
||||
}) | (EventEmitter & {
|
||||
end(): any;
|
||||
write(chunk: any, ...args: any[]): any;
|
||||
});
|
||||
/**
|
||||
* Any stream that can be read from
|
||||
*/
|
||||
export type Readable = Minipass<any, any, any> | NodeJS.ReadStream | (NodeJS.ReadStream & {
|
||||
fd: number;
|
||||
}) | (EventEmitter & {
|
||||
pause(): any;
|
||||
resume(): any;
|
||||
pipe(...destArgs: any[]): any;
|
||||
});
|
||||
/**
|
||||
* Utility type that can be iterated sync or async
|
||||
*/
|
||||
export type DualIterable<T> = Iterable<T> & AsyncIterable<T>;
|
||||
type EventArguments = Record<string | symbol, unknown[]>;
|
||||
/**
|
||||
* The listing of events that a Minipass class can emit.
|
||||
* Extend this when extending the Minipass class, and pass as
|
||||
* the third template argument. The key is the name of the event,
|
||||
* and the value is the argument list.
|
||||
*
|
||||
* Any undeclared events will still be allowed, but the handler will get
|
||||
* arguments as `unknown[]`.
|
||||
*/
|
||||
export interface Events<RType extends any = Buffer> extends EventArguments {
|
||||
readable: [];
|
||||
data: [chunk: RType];
|
||||
error: [er: unknown];
|
||||
abort: [reason: unknown];
|
||||
drain: [];
|
||||
resume: [];
|
||||
end: [];
|
||||
finish: [];
|
||||
prefinish: [];
|
||||
close: [];
|
||||
[DESTROYED]: [er?: unknown];
|
||||
[ERROR]: [er: unknown];
|
||||
}
|
||||
/**
|
||||
* String or buffer-like data that can be joined and sliced
|
||||
*/
|
||||
export type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string;
|
||||
export type BufferOrString = Buffer | string;
|
||||
/**
|
||||
* Options passed to the Minipass constructor.
|
||||
*/
|
||||
export type SharedOptions = {
|
||||
/**
|
||||
* Defer all data emission and other events until the end of the
|
||||
* current tick, similar to Node core streams
|
||||
*/
|
||||
async?: boolean;
|
||||
/**
|
||||
* A signal which will abort the stream
|
||||
*/
|
||||
signal?: AbortSignal;
|
||||
/**
|
||||
* Output string encoding. Set to `null` or `'buffer'` (or omit) to
|
||||
* emit Buffer objects rather than strings.
|
||||
*
|
||||
* Conflicts with `objectMode`
|
||||
*/
|
||||
encoding?: BufferEncoding | null | 'buffer';
|
||||
/**
|
||||
* Output data exactly as it was written, supporting non-buffer/string
|
||||
* data (such as arbitrary objects, falsey values, etc.)
|
||||
*
|
||||
* Conflicts with `encoding`
|
||||
*/
|
||||
objectMode?: boolean;
|
||||
};
|
||||
/**
|
||||
* Options for a string encoded output
|
||||
*/
|
||||
export type EncodingOptions = SharedOptions & {
|
||||
encoding: BufferEncoding;
|
||||
objectMode?: false;
|
||||
};
|
||||
/**
|
||||
* Options for contiguous data buffer output
|
||||
*/
|
||||
export type BufferOptions = SharedOptions & {
|
||||
encoding?: null | 'buffer';
|
||||
objectMode?: false;
|
||||
};
|
||||
/**
|
||||
* Options for objectMode arbitrary output
|
||||
*/
|
||||
export type ObjectModeOptions = SharedOptions & {
|
||||
objectMode: true;
|
||||
encoding?: null;
|
||||
};
|
||||
/**
|
||||
* Utility type to determine allowed options based on read type
|
||||
*/
|
||||
export type Options<T> = ObjectModeOptions | (T extends string ? EncodingOptions : T extends Buffer ? BufferOptions : SharedOptions);
|
||||
export {};
|
||||
}
|
||||
/**
|
||||
* Main export, the Minipass class
|
||||
*
|
||||
* `RType` is the type of data emitted, defaults to Buffer
|
||||
*
|
||||
* `WType` is the type of data to be written, if RType is buffer or string,
|
||||
* then any {@link Minipass.ContiguousData} is allowed.
|
||||
*
|
||||
* `Events` is the set of event handler signatures that this object
|
||||
* will emit, see {@link Minipass.Events}
|
||||
*/
|
||||
export declare class Minipass<RType extends unknown = Buffer, WType extends unknown = RType extends Minipass.BufferOrString ? Minipass.ContiguousData : RType, Events extends Minipass.Events<RType> = Minipass.Events<RType>> extends EventEmitter implements Minipass.DualIterable<RType> {
|
||||
[FLOWING]: boolean;
|
||||
[PAUSED]: boolean;
|
||||
[PIPES]: Pipe<RType>[];
|
||||
[BUFFER]: RType[];
|
||||
[OBJECTMODE]: boolean;
|
||||
[ENCODING]: BufferEncoding | null;
|
||||
[ASYNC]: boolean;
|
||||
[DECODER]: SD | null;
|
||||
[EOF]: boolean;
|
||||
[EMITTED_END]: boolean;
|
||||
[EMITTING_END]: boolean;
|
||||
[CLOSED]: boolean;
|
||||
[EMITTED_ERROR]: unknown;
|
||||
[BUFFERLENGTH]: number;
|
||||
[DESTROYED]: boolean;
|
||||
[SIGNAL]?: AbortSignal;
|
||||
[ABORTED]: boolean;
|
||||
[DATALISTENERS]: number;
|
||||
[DISCARDED]: boolean;
|
||||
/**
|
||||
* true if the stream can be written
|
||||
*/
|
||||
writable: boolean;
|
||||
/**
|
||||
* true if the stream can be read
|
||||
*/
|
||||
readable: boolean;
|
||||
/**
|
||||
* If `RType` is Buffer, then options do not need to be provided.
|
||||
* Otherwise, an options object must be provided to specify either
|
||||
* {@link Minipass.SharedOptions.objectMode} or
|
||||
* {@link Minipass.SharedOptions.encoding}, as appropriate.
|
||||
*/
|
||||
constructor(...args: [Minipass.ObjectModeOptions] | (RType extends Buffer ? [] | [Minipass.Options<RType>] : [Minipass.Options<RType>]));
|
||||
/**
|
||||
* The amount of data stored in the buffer waiting to be read.
|
||||
*
|
||||
* For Buffer strings, this will be the total byte length.
|
||||
* For string encoding streams, this will be the string character length,
|
||||
* according to JavaScript's `string.length` logic.
|
||||
* For objectMode streams, this is a count of the items waiting to be
|
||||
* emitted.
|
||||
*/
|
||||
get bufferLength(): number;
|
||||
/**
|
||||
* The `BufferEncoding` currently in use, or `null`
|
||||
*/
|
||||
get encoding(): BufferEncoding | null;
|
||||
/**
|
||||
* @deprecated - This is a read only property
|
||||
*/
|
||||
set encoding(_enc: BufferEncoding | null);
|
||||
/**
|
||||
* @deprecated - Encoding may only be set at instantiation time
|
||||
*/
|
||||
setEncoding(_enc: Minipass.Encoding): void;
|
||||
/**
|
||||
* True if this is an objectMode stream
|
||||
*/
|
||||
get objectMode(): boolean;
|
||||
/**
|
||||
* @deprecated - This is a read-only property
|
||||
*/
|
||||
set objectMode(_om: boolean);
|
||||
/**
|
||||
* true if this is an async stream
|
||||
*/
|
||||
get ['async'](): boolean;
|
||||
/**
|
||||
* Set to true to make this stream async.
|
||||
*
|
||||
* Once set, it cannot be unset, as this would potentially cause incorrect
|
||||
* behavior. Ie, a sync stream can be made async, but an async stream
|
||||
* cannot be safely made sync.
|
||||
*/
|
||||
set ['async'](a: boolean);
|
||||
[ABORT](): void;
|
||||
/**
|
||||
* True if the stream has been aborted.
|
||||
*/
|
||||
get aborted(): boolean;
|
||||
/**
|
||||
* No-op setter. Stream aborted status is set via the AbortSignal provided
|
||||
* in the constructor options.
|
||||
*/
|
||||
set aborted(_: boolean);
|
||||
/**
|
||||
* Write data into the stream
|
||||
*
|
||||
* If the chunk written is a string, and encoding is not specified, then
|
||||
* `utf8` will be assumed. If the stream encoding matches the encoding of
|
||||
* a written string, and the state of the string decoder allows it, then
|
||||
* the string will be passed through to either the output or the internal
|
||||
* buffer without any processing. Otherwise, it will be turned into a
|
||||
* Buffer object for processing into the desired encoding.
|
||||
*
|
||||
* If provided, `cb` function is called immediately before return for
|
||||
* sync streams, or on next tick for async streams, because for this
|
||||
* base class, a chunk is considered "processed" once it is accepted
|
||||
* and either emitted or buffered. That is, the callback does not indicate
|
||||
* that the chunk has been eventually emitted, though of course child
|
||||
* classes can override this function to do whatever processing is required
|
||||
* and call `super.write(...)` only once processing is completed.
|
||||
*/
|
||||
write(chunk: WType, cb?: () => void): boolean;
|
||||
write(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): boolean;
|
||||
/**
|
||||
* Low-level explicit read method.
|
||||
*
|
||||
* In objectMode, the argument is ignored, and one item is returned if
|
||||
* available.
|
||||
*
|
||||
* `n` is the number of bytes (or in the case of encoding streams,
|
||||
* characters) to consume. If `n` is not provided, then the entire buffer
|
||||
* is returned, or `null` is returned if no data is available.
|
||||
*
|
||||
* If `n` is greater that the amount of data in the internal buffer,
|
||||
* then `null` is returned.
|
||||
*/
|
||||
read(n?: number | null): RType | null;
|
||||
[READ](n: number | null, chunk: RType): RType;
|
||||
/**
|
||||
* End the stream, optionally providing a final write.
|
||||
*
|
||||
* See {@link Minipass#write} for argument descriptions
|
||||
*/
|
||||
end(cb?: () => void): this;
|
||||
end(chunk: WType, cb?: () => void): this;
|
||||
end(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): this;
|
||||
[RESUME](): void;
|
||||
/**
|
||||
* Resume the stream if it is currently in a paused state
|
||||
*
|
||||
* If called when there are no pipe destinations or `data` event listeners,
|
||||
* this will place the stream in a "discarded" state, where all data will
|
||||
* be thrown away. The discarded state is removed if a pipe destination or
|
||||
* data handler is added, if pause() is called, or if any synchronous or
|
||||
* asynchronous iteration is started.
|
||||
*/
|
||||
resume(): void;
|
||||
/**
|
||||
* Pause the stream
|
||||
*/
|
||||
pause(): void;
|
||||
/**
|
||||
* true if the stream has been forcibly destroyed
|
||||
*/
|
||||
get destroyed(): boolean;
|
||||
/**
|
||||
* true if the stream is currently in a flowing state, meaning that
|
||||
* any writes will be immediately emitted.
|
||||
*/
|
||||
get flowing(): boolean;
|
||||
/**
|
||||
* true if the stream is currently in a paused state
|
||||
*/
|
||||
get paused(): boolean;
|
||||
[BUFFERPUSH](chunk: RType): void;
|
||||
[BUFFERSHIFT](): RType;
|
||||
[FLUSH](noDrain?: boolean): void;
|
||||
[FLUSHCHUNK](chunk: RType): boolean;
|
||||
/**
|
||||
* Pipe all data emitted by this stream into the destination provided.
|
||||
*
|
||||
* Triggers the flow of data.
|
||||
*/
|
||||
pipe<W extends Minipass.Writable>(dest: W, opts?: PipeOptions): W;
|
||||
/**
|
||||
* Fully unhook a piped destination stream.
|
||||
*
|
||||
* If the destination stream was the only consumer of this stream (ie,
|
||||
* there are no other piped destinations or `'data'` event listeners)
|
||||
* then the flow of data will stop until there is another consumer or
|
||||
* {@link Minipass#resume} is explicitly called.
|
||||
*/
|
||||
unpipe<W extends Minipass.Writable>(dest: W): void;
|
||||
/**
|
||||
* Alias for {@link Minipass#on}
|
||||
*/
|
||||
addListener<Event extends keyof Events>(ev: Event, handler: (...args: Events[Event]) => any): this;
|
||||
/**
|
||||
* Mostly identical to `EventEmitter.on`, with the following
|
||||
* behavior differences to prevent data loss and unnecessary hangs:
|
||||
*
|
||||
* - Adding a 'data' event handler will trigger the flow of data
|
||||
*
|
||||
* - Adding a 'readable' event handler when there is data waiting to be read
|
||||
* will cause 'readable' to be emitted immediately.
|
||||
*
|
||||
* - Adding an 'endish' event handler ('end', 'finish', etc.) which has
|
||||
* already passed will cause the event to be emitted immediately and all
|
||||
* handlers removed.
|
||||
*
|
||||
* - Adding an 'error' event handler after an error has been emitted will
|
||||
* cause the event to be re-emitted immediately with the error previously
|
||||
* raised.
|
||||
*/
|
||||
on<Event extends keyof Events>(ev: Event, handler: (...args: Events[Event]) => any): this;
|
||||
/**
|
||||
* Alias for {@link Minipass#off}
|
||||
*/
|
||||
removeListener<Event extends keyof Events>(ev: Event, handler: (...args: Events[Event]) => any): this;
|
||||
/**
|
||||
* Mostly identical to `EventEmitter.off`
|
||||
*
|
||||
* If a 'data' event handler is removed, and it was the last consumer
|
||||
* (ie, there are no pipe destinations or other 'data' event listeners),
|
||||
* then the flow of data will stop until there is another consumer or
|
||||
* {@link Minipass#resume} is explicitly called.
|
||||
*/
|
||||
off<Event extends keyof Events>(ev: Event, handler: (...args: Events[Event]) => any): this;
|
||||
/**
|
||||
* Mostly identical to `EventEmitter.removeAllListeners`
|
||||
*
|
||||
* If all 'data' event handlers are removed, and they were the last consumer
|
||||
* (ie, there are no pipe destinations), then the flow of data will stop
|
||||
* until there is another consumer or {@link Minipass#resume} is explicitly
|
||||
* called.
|
||||
*/
|
||||
removeAllListeners<Event extends keyof Events>(ev?: Event): this;
|
||||
/**
|
||||
* true if the 'end' event has been emitted
|
||||
*/
|
||||
get emittedEnd(): boolean;
|
||||
[MAYBE_EMIT_END](): void;
|
||||
/**
|
||||
* Mostly identical to `EventEmitter.emit`, with the following
|
||||
* behavior differences to prevent data loss and unnecessary hangs:
|
||||
*
|
||||
* If the stream has been destroyed, and the event is something other
|
||||
* than 'close' or 'error', then `false` is returned and no handlers
|
||||
* are called.
|
||||
*
|
||||
* If the event is 'end', and has already been emitted, then the event
|
||||
* is ignored. If the stream is in a paused or non-flowing state, then
|
||||
* the event will be deferred until data flow resumes. If the stream is
|
||||
* async, then handlers will be called on the next tick rather than
|
||||
* immediately.
|
||||
*
|
||||
* If the event is 'close', and 'end' has not yet been emitted, then
|
||||
* the event will be deferred until after 'end' is emitted.
|
||||
*
|
||||
* If the event is 'error', and an AbortSignal was provided for the stream,
|
||||
* and there are no listeners, then the event is ignored, matching the
|
||||
* behavior of node core streams in the presense of an AbortSignal.
|
||||
*
|
||||
* If the event is 'finish' or 'prefinish', then all listeners will be
|
||||
* removed after emitting the event, to prevent double-firing.
|
||||
*/
|
||||
emit<Event extends keyof Events>(ev: Event, ...args: Events[Event]): boolean;
|
||||
[EMITDATA](data: RType): boolean;
|
||||
[EMITEND](): boolean;
|
||||
[EMITEND2](): boolean;
|
||||
/**
|
||||
* Return a Promise that resolves to an array of all emitted data once
|
||||
* the stream ends.
|
||||
*/
|
||||
collect(): Promise<RType[] & {
|
||||
dataLength: number;
|
||||
}>;
|
||||
/**
|
||||
* Return a Promise that resolves to the concatenation of all emitted data
|
||||
* once the stream ends.
|
||||
*
|
||||
* Not allowed on objectMode streams.
|
||||
*/
|
||||
concat(): Promise<RType>;
|
||||
/**
|
||||
* Return a void Promise that resolves once the stream ends.
|
||||
*/
|
||||
promise(): Promise<void>;
|
||||
/**
|
||||
* Asynchronous `for await of` iteration.
|
||||
*
|
||||
* This will continue emitting all chunks until the stream terminates.
|
||||
*/
|
||||
[Symbol.asyncIterator](): AsyncGenerator<RType, void, void>;
|
||||
/**
|
||||
* Synchronous `for of` iteration.
|
||||
*
|
||||
* The iteration will terminate when the internal buffer runs out, even
|
||||
* if the stream has not yet terminated.
|
||||
*/
|
||||
[Symbol.iterator](): Generator<RType, void, void>;
|
||||
/**
|
||||
* Destroy a stream, preventing it from being used for any further purpose.
|
||||
*
|
||||
* If the stream has a `close()` method, then it will be called on
|
||||
* destruction.
|
||||
*
|
||||
* After destruction, any attempt to write data, read data, or emit most
|
||||
* events will be ignored.
|
||||
*
|
||||
* If an error argument is provided, then it will be emitted in an
|
||||
* 'error' event.
|
||||
*/
|
||||
destroy(er?: unknown): this;
|
||||
/**
|
||||
* Alias for {@link isStream}
|
||||
*
|
||||
* Former export location, maintained for backwards compatibility.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
static get isStream(): (s: any) => s is Minipass<any, any, any> | NodeJS.ReadStream | NodeJS.WriteStream | (EventEmitter<any> & {
|
||||
end(): any;
|
||||
write(chunk: any, ...args: any[]): any;
|
||||
}) | (EventEmitter<any> & {
|
||||
pause(): any;
|
||||
resume(): any;
|
||||
pipe(...destArgs: any[]): any;
|
||||
}) | (NodeJS.ReadStream & {
|
||||
fd: number;
|
||||
}) | (NodeJS.WriteStream & {
|
||||
fd: number;
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
electron/node_modules/rimraf/node_modules/minipass/dist/esm/index.d.ts.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/minipass/dist/esm/index.d.ts.map
generated
vendored
File diff suppressed because one or more lines are too long
1020
electron/node_modules/rimraf/node_modules/minipass/dist/esm/index.js
generated
vendored
1020
electron/node_modules/rimraf/node_modules/minipass/dist/esm/index.js
generated
vendored
File diff suppressed because it is too large
Load diff
1
electron/node_modules/rimraf/node_modules/minipass/dist/esm/index.js.map
generated
vendored
1
electron/node_modules/rimraf/node_modules/minipass/dist/esm/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
3
electron/node_modules/rimraf/node_modules/minipass/dist/esm/package.json
generated
vendored
3
electron/node_modules/rimraf/node_modules/minipass/dist/esm/package.json
generated
vendored
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"type": "module"
|
||||
}
|
||||
77
electron/node_modules/rimraf/node_modules/minipass/package.json
generated
vendored
77
electron/node_modules/rimraf/node_modules/minipass/package.json
generated
vendored
|
|
@ -1,77 +0,0 @@
|
|||
{
|
||||
"name": "minipass",
|
||||
"version": "7.1.3",
|
||||
"description": "minimal implementation of a PassThrough stream",
|
||||
"main": "./dist/commonjs/index.js",
|
||||
"types": "./dist/commonjs/index.d.ts",
|
||||
"module": "./dist/esm/index.js",
|
||||
"type": "module",
|
||||
"tshy": {
|
||||
"selfLink": false,
|
||||
"compiler": "tsgo",
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
".": "./src/index.ts"
|
||||
}
|
||||
},
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./dist/esm/index.d.ts",
|
||||
"default": "./dist/esm/index.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/commonjs/index.d.ts",
|
||||
"default": "./dist/commonjs/index.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"preversion": "npm test",
|
||||
"postversion": "npm publish",
|
||||
"prepublishOnly": "git push origin --follow-tags",
|
||||
"prepare": "tshy",
|
||||
"pretest": "npm run prepare",
|
||||
"presnap": "npm run prepare",
|
||||
"test": "tap",
|
||||
"snap": "tap",
|
||||
"format": "prettier --write . --loglevel warn",
|
||||
"typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts"
|
||||
},
|
||||
"prettier": {
|
||||
"semi": false,
|
||||
"printWidth": 75,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"singleQuote": true,
|
||||
"jsxSingleQuote": false,
|
||||
"bracketSameLine": true,
|
||||
"arrowParens": "avoid",
|
||||
"endOfLine": "lf"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/end-of-stream": "^1.4.2",
|
||||
"@types/node": "^25.2.3",
|
||||
"end-of-stream": "^1.4.0",
|
||||
"node-abort-controller": "^3.1.1",
|
||||
"prettier": "^3.8.1",
|
||||
"tap": "^21.6.1",
|
||||
"through2": "^2.0.3",
|
||||
"tshy": "^3.3.2",
|
||||
"typedoc": "^0.28.17"
|
||||
},
|
||||
"repository": "https://github.com/isaacs/minipass",
|
||||
"keywords": [
|
||||
"passthrough",
|
||||
"stream"
|
||||
],
|
||||
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
|
||||
"license": "BlueOak-1.0.0",
|
||||
"engines": {
|
||||
"node": ">=16 || 14 >=14.17"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue