This commit is contained in:
parent
55470c090d
commit
6947a1adba
1260 changed files with 111297 additions and 0 deletions
1
@capacitor/cli/node_modules/.bin/rimraf
generated
vendored
Symbolic link
1
@capacitor/cli/node_modules/.bin/rimraf
generated
vendored
Symbolic link
|
@ -0,0 +1 @@
|
|||
../rimraf/dist/cjs/src/bin.js
|
1
@capacitor/cli/node_modules/.bin/semver
generated
vendored
Symbolic link
1
@capacitor/cli/node_modules/.bin/semver
generated
vendored
Symbolic link
|
@ -0,0 +1 @@
|
|||
../semver/bin/semver.js
|
2
@capacitor/cli/node_modules/brace-expansion/.github/FUNDING.yml
generated
vendored
Normal file
2
@capacitor/cli/node_modules/brace-expansion/.github/FUNDING.yml
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
tidelift: "npm/brace-expansion"
|
||||
patreon: juliangruber
|
21
@capacitor/cli/node_modules/brace-expansion/LICENSE
generated
vendored
Normal file
21
@capacitor/cli/node_modules/brace-expansion/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
|
||||
|
||||
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.
|
135
@capacitor/cli/node_modules/brace-expansion/README.md
generated
vendored
Normal file
135
@capacitor/cli/node_modules/brace-expansion/README.md
generated
vendored
Normal file
|
@ -0,0 +1,135 @@
|
|||
# brace-expansion
|
||||
|
||||
[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html),
|
||||
as known from sh/bash, in JavaScript.
|
||||
|
||||
[](http://travis-ci.org/juliangruber/brace-expansion)
|
||||
[](https://www.npmjs.org/package/brace-expansion)
|
||||
[](https://greenkeeper.io/)
|
||||
|
||||
[](https://ci.testling.com/juliangruber/brace-expansion)
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var expand = require('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
|
||||
var expand = require('brace-expansion');
|
||||
```
|
||||
|
||||
### var expanded = expand(str)
|
||||
|
||||
Return an array of all possible and valid expansions of `str`. If none are
|
||||
found, `[str]` is returned.
|
||||
|
||||
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.
|
||||
|
||||
## Installation
|
||||
|
||||
With [npm](https://npmjs.org) do:
|
||||
|
||||
```bash
|
||||
npm install brace-expansion
|
||||
```
|
||||
|
||||
## Contributors
|
||||
|
||||
- [Julian Gruber](https://github.com/juliangruber)
|
||||
- [Isaac Z. Schlueter](https://github.com/isaacs)
|
||||
|
||||
## Sponsors
|
||||
|
||||
This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)!
|
||||
|
||||
Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)!
|
||||
|
||||
## Security contact information
|
||||
|
||||
To report a security vulnerability, please use the
|
||||
[Tidelift security contact](https://tidelift.com/security).
|
||||
Tidelift will coordinate the fix and disclosure.
|
||||
|
||||
## License
|
||||
|
||||
(MIT)
|
||||
|
||||
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
|
||||
|
||||
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.
|
203
@capacitor/cli/node_modules/brace-expansion/index.js
generated
vendored
Normal file
203
@capacitor/cli/node_modules/brace-expansion/index.js
generated
vendored
Normal file
|
@ -0,0 +1,203 @@
|
|||
var balanced = require('balanced-match');
|
||||
|
||||
module.exports = expandTop;
|
||||
|
||||
var escSlash = '\0SLASH'+Math.random()+'\0';
|
||||
var escOpen = '\0OPEN'+Math.random()+'\0';
|
||||
var escClose = '\0CLOSE'+Math.random()+'\0';
|
||||
var escComma = '\0COMMA'+Math.random()+'\0';
|
||||
var escPeriod = '\0PERIOD'+Math.random()+'\0';
|
||||
|
||||
function numeric(str) {
|
||||
return parseInt(str, 10) == str
|
||||
? parseInt(str, 10)
|
||||
: str.charCodeAt(0);
|
||||
}
|
||||
|
||||
function escapeBraces(str) {
|
||||
return str.split('\\\\').join(escSlash)
|
||||
.split('\\{').join(escOpen)
|
||||
.split('\\}').join(escClose)
|
||||
.split('\\,').join(escComma)
|
||||
.split('\\.').join(escPeriod);
|
||||
}
|
||||
|
||||
function unescapeBraces(str) {
|
||||
return str.split(escSlash).join('\\')
|
||||
.split(escOpen).join('{')
|
||||
.split(escClose).join('}')
|
||||
.split(escComma).join(',')
|
||||
.split(escPeriod).join('.');
|
||||
}
|
||||
|
||||
|
||||
// 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 [''];
|
||||
|
||||
var parts = [];
|
||||
var m = balanced('{', '}', str);
|
||||
|
||||
if (!m)
|
||||
return str.split(',');
|
||||
|
||||
var pre = m.pre;
|
||||
var body = m.body;
|
||||
var post = m.post;
|
||||
var p = pre.split(',');
|
||||
|
||||
p[p.length-1] += '{' + body + '}';
|
||||
var 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 expandTop(str) {
|
||||
if (!str)
|
||||
return [];
|
||||
|
||||
// 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.substr(0, 2) === '{}') {
|
||||
str = '\\{\\}' + str.substr(2);
|
||||
}
|
||||
|
||||
return expand(escapeBraces(str), 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, isTop) {
|
||||
var expansions = [];
|
||||
|
||||
var m = balanced('{', '}', str);
|
||||
if (!m) return [str];
|
||||
|
||||
// no need to expand pre, since it is guaranteed to be free of brace-sets
|
||||
var pre = m.pre;
|
||||
var post = m.post.length
|
||||
? expand(m.post, false)
|
||||
: [''];
|
||||
|
||||
if (/\$$/.test(m.pre)) {
|
||||
for (var k = 0; k < post.length; k++) {
|
||||
var expansion = pre+ '{' + m.body + '}' + post[k];
|
||||
expansions.push(expansion);
|
||||
}
|
||||
} else {
|
||||
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
||||
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
||||
var isSequence = isNumericSequence || isAlphaSequence;
|
||||
var 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);
|
||||
}
|
||||
return [str];
|
||||
}
|
||||
|
||||
var n;
|
||||
if (isSequence) {
|
||||
n = m.body.split(/\.\./);
|
||||
} else {
|
||||
n = parseCommaParts(m.body);
|
||||
if (n.length === 1) {
|
||||
// x{{a,b}}y ==> x{a}y x{b}y
|
||||
n = expand(n[0], false).map(embrace);
|
||||
if (n.length === 1) {
|
||||
return post.map(function(p) {
|
||||
return m.pre + n[0] + p;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// at this point, n is the parts, and we know it's not a comma set
|
||||
// with a single entry.
|
||||
var N;
|
||||
|
||||
if (isSequence) {
|
||||
var x = numeric(n[0]);
|
||||
var y = numeric(n[1]);
|
||||
var width = Math.max(n[0].length, n[1].length)
|
||||
var incr = n.length == 3
|
||||
? Math.abs(numeric(n[2]))
|
||||
: 1;
|
||||
var test = lte;
|
||||
var reverse = y < x;
|
||||
if (reverse) {
|
||||
incr *= -1;
|
||||
test = gte;
|
||||
}
|
||||
var pad = n.some(isPadded);
|
||||
|
||||
N = [];
|
||||
|
||||
for (var i = x; test(i, y); i += incr) {
|
||||
var c;
|
||||
if (isAlphaSequence) {
|
||||
c = String.fromCharCode(i);
|
||||
if (c === '\\')
|
||||
c = '';
|
||||
} else {
|
||||
c = String(i);
|
||||
if (pad) {
|
||||
var need = width - c.length;
|
||||
if (need > 0) {
|
||||
var 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 (var j = 0; j < n.length; j++) {
|
||||
N.push.apply(N, expand(n[j], false));
|
||||
}
|
||||
}
|
||||
|
||||
for (var j = 0; j < N.length; j++) {
|
||||
for (var k = 0; k < post.length; k++) {
|
||||
var expansion = pre + N[j] + post[k];
|
||||
if (!isTop || isSequence || expansion)
|
||||
expansions.push(expansion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return expansions;
|
||||
}
|
||||
|
46
@capacitor/cli/node_modules/brace-expansion/package.json
generated
vendored
Normal file
46
@capacitor/cli/node_modules/brace-expansion/package.json
generated
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"name": "brace-expansion",
|
||||
"description": "Brace expansion as known from sh/bash",
|
||||
"version": "2.0.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/juliangruber/brace-expansion.git"
|
||||
},
|
||||
"homepage": "https://github.com/juliangruber/brace-expansion",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "tape test/*.js",
|
||||
"gentest": "bash test/generate.sh",
|
||||
"bench": "matcha test/perf/bench.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@c4312/matcha": "^1.3.1",
|
||||
"tape": "^4.6.0"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": {
|
||||
"name": "Julian Gruber",
|
||||
"email": "mail@juliangruber.com",
|
||||
"url": "http://juliangruber.com"
|
||||
},
|
||||
"license": "MIT",
|
||||
"testling": {
|
||||
"files": "test/*.js",
|
||||
"browsers": [
|
||||
"ie/8..latest",
|
||||
"firefox/20..latest",
|
||||
"firefox/nightly",
|
||||
"chrome/25..latest",
|
||||
"chrome/canary",
|
||||
"opera/12..latest",
|
||||
"opera/next",
|
||||
"safari/5.1..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"android-browser/4.2..latest"
|
||||
]
|
||||
}
|
||||
}
|
22
@capacitor/cli/node_modules/commander/LICENSE
generated
vendored
Normal file
22
@capacitor/cli/node_modules/commander/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
(The MIT License)
|
||||
|
||||
Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
|
||||
|
||||
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.
|
1129
@capacitor/cli/node_modules/commander/Readme.md
generated
vendored
Normal file
1129
@capacitor/cli/node_modules/commander/Readme.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
16
@capacitor/cli/node_modules/commander/esm.mjs
generated
vendored
Normal file
16
@capacitor/cli/node_modules/commander/esm.mjs
generated
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
import commander from './index.js';
|
||||
|
||||
// wrapper to provide named exports for ESM.
|
||||
export const {
|
||||
program,
|
||||
createCommand,
|
||||
createArgument,
|
||||
createOption,
|
||||
CommanderError,
|
||||
InvalidArgumentError,
|
||||
InvalidOptionArgumentError, // deprecated old name
|
||||
Command,
|
||||
Argument,
|
||||
Option,
|
||||
Help
|
||||
} = commander;
|
27
@capacitor/cli/node_modules/commander/index.js
generated
vendored
Normal file
27
@capacitor/cli/node_modules/commander/index.js
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
const { Argument } = require('./lib/argument.js');
|
||||
const { Command } = require('./lib/command.js');
|
||||
const { CommanderError, InvalidArgumentError } = require('./lib/error.js');
|
||||
const { Help } = require('./lib/help.js');
|
||||
const { Option } = require('./lib/option.js');
|
||||
|
||||
// @ts-check
|
||||
|
||||
/**
|
||||
* Expose the root command.
|
||||
*/
|
||||
|
||||
exports = module.exports = new Command();
|
||||
exports.program = exports; // More explicit access to global command.
|
||||
// Implicit export of createArgument, createCommand, and createOption.
|
||||
|
||||
/**
|
||||
* Expose classes
|
||||
*/
|
||||
|
||||
exports.Argument = Argument;
|
||||
exports.Command = Command;
|
||||
exports.CommanderError = CommanderError;
|
||||
exports.Help = Help;
|
||||
exports.InvalidArgumentError = InvalidArgumentError;
|
||||
exports.InvalidOptionArgumentError = InvalidArgumentError; // Deprecated
|
||||
exports.Option = Option;
|
147
@capacitor/cli/node_modules/commander/lib/argument.js
generated
vendored
Normal file
147
@capacitor/cli/node_modules/commander/lib/argument.js
generated
vendored
Normal file
|
@ -0,0 +1,147 @@
|
|||
const { InvalidArgumentError } = require('./error.js');
|
||||
|
||||
// @ts-check
|
||||
|
||||
class Argument {
|
||||
/**
|
||||
* Initialize a new command argument with the given name and description.
|
||||
* The default is that the argument is required, and you can explicitly
|
||||
* indicate this with <> around the name. Put [] around the name for an optional argument.
|
||||
*
|
||||
* @param {string} name
|
||||
* @param {string} [description]
|
||||
*/
|
||||
|
||||
constructor(name, description) {
|
||||
this.description = description || '';
|
||||
this.variadic = false;
|
||||
this.parseArg = undefined;
|
||||
this.defaultValue = undefined;
|
||||
this.defaultValueDescription = undefined;
|
||||
this.argChoices = undefined;
|
||||
|
||||
switch (name[0]) {
|
||||
case '<': // e.g. <required>
|
||||
this.required = true;
|
||||
this._name = name.slice(1, -1);
|
||||
break;
|
||||
case '[': // e.g. [optional]
|
||||
this.required = false;
|
||||
this._name = name.slice(1, -1);
|
||||
break;
|
||||
default:
|
||||
this.required = true;
|
||||
this._name = name;
|
||||
break;
|
||||
}
|
||||
|
||||
if (this._name.length > 3 && this._name.slice(-3) === '...') {
|
||||
this.variadic = true;
|
||||
this._name = this._name.slice(0, -3);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return argument name.
|
||||
*
|
||||
* @return {string}
|
||||
*/
|
||||
|
||||
name() {
|
||||
return this._name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @api private
|
||||
*/
|
||||
|
||||
_concatValue(value, previous) {
|
||||
if (previous === this.defaultValue || !Array.isArray(previous)) {
|
||||
return [value];
|
||||
}
|
||||
|
||||
return previous.concat(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the default value, and optionally supply the description to be displayed in the help.
|
||||
*
|
||||
* @param {any} value
|
||||
* @param {string} [description]
|
||||
* @return {Argument}
|
||||
*/
|
||||
|
||||
default(value, description) {
|
||||
this.defaultValue = value;
|
||||
this.defaultValueDescription = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the custom handler for processing CLI command arguments into argument values.
|
||||
*
|
||||
* @param {Function} [fn]
|
||||
* @return {Argument}
|
||||
*/
|
||||
|
||||
argParser(fn) {
|
||||
this.parseArg = fn;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Only allow argument value to be one of choices.
|
||||
*
|
||||
* @param {string[]} values
|
||||
* @return {Argument}
|
||||
*/
|
||||
|
||||
choices(values) {
|
||||
this.argChoices = values.slice();
|
||||
this.parseArg = (arg, previous) => {
|
||||
if (!this.argChoices.includes(arg)) {
|
||||
throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(', ')}.`);
|
||||
}
|
||||
if (this.variadic) {
|
||||
return this._concatValue(arg, previous);
|
||||
}
|
||||
return arg;
|
||||
};
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make argument required.
|
||||
*/
|
||||
argRequired() {
|
||||
this.required = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make argument optional.
|
||||
*/
|
||||
argOptional() {
|
||||
this.required = false;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes an argument and returns its human readable equivalent for help usage.
|
||||
*
|
||||
* @param {Argument} arg
|
||||
* @return {string}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function humanReadableArgName(arg) {
|
||||
const nameOutput = arg.name() + (arg.variadic === true ? '...' : '');
|
||||
|
||||
return arg.required
|
||||
? '<' + nameOutput + '>'
|
||||
: '[' + nameOutput + ']';
|
||||
}
|
||||
|
||||
exports.Argument = Argument;
|
||||
exports.humanReadableArgName = humanReadableArgName;
|
2179
@capacitor/cli/node_modules/commander/lib/command.js
generated
vendored
Normal file
2179
@capacitor/cli/node_modules/commander/lib/command.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
45
@capacitor/cli/node_modules/commander/lib/error.js
generated
vendored
Normal file
45
@capacitor/cli/node_modules/commander/lib/error.js
generated
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
// @ts-check
|
||||
|
||||
/**
|
||||
* CommanderError class
|
||||
* @class
|
||||
*/
|
||||
class CommanderError extends Error {
|
||||
/**
|
||||
* Constructs the CommanderError class
|
||||
* @param {number} exitCode suggested exit code which could be used with process.exit
|
||||
* @param {string} code an id string representing the error
|
||||
* @param {string} message human-readable description of the error
|
||||
* @constructor
|
||||
*/
|
||||
constructor(exitCode, code, message) {
|
||||
super(message);
|
||||
// properly capture stack trace in Node.js
|
||||
Error.captureStackTrace(this, this.constructor);
|
||||
this.name = this.constructor.name;
|
||||
this.code = code;
|
||||
this.exitCode = exitCode;
|
||||
this.nestedError = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* InvalidArgumentError class
|
||||
* @class
|
||||
*/
|
||||
class InvalidArgumentError extends CommanderError {
|
||||
/**
|
||||
* Constructs the InvalidArgumentError class
|
||||
* @param {string} [message] explanation of why argument is invalid
|
||||
* @constructor
|
||||
*/
|
||||
constructor(message) {
|
||||
super(1, 'commander.invalidArgument', message);
|
||||
// properly capture stack trace in Node.js
|
||||
Error.captureStackTrace(this, this.constructor);
|
||||
this.name = this.constructor.name;
|
||||
}
|
||||
}
|
||||
|
||||
exports.CommanderError = CommanderError;
|
||||
exports.InvalidArgumentError = InvalidArgumentError;
|
461
@capacitor/cli/node_modules/commander/lib/help.js
generated
vendored
Normal file
461
@capacitor/cli/node_modules/commander/lib/help.js
generated
vendored
Normal file
|
@ -0,0 +1,461 @@
|
|||
const { humanReadableArgName } = require('./argument.js');
|
||||
|
||||
/**
|
||||
* TypeScript import types for JSDoc, used by Visual Studio Code IntelliSense and `npm run typescript-checkJS`
|
||||
* https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#import-types
|
||||
* @typedef { import("./argument.js").Argument } Argument
|
||||
* @typedef { import("./command.js").Command } Command
|
||||
* @typedef { import("./option.js").Option } Option
|
||||
*/
|
||||
|
||||
// @ts-check
|
||||
|
||||
// Although this is a class, methods are static in style to allow override using subclass or just functions.
|
||||
class Help {
|
||||
constructor() {
|
||||
this.helpWidth = undefined;
|
||||
this.sortSubcommands = false;
|
||||
this.sortOptions = false;
|
||||
this.showGlobalOptions = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.
|
||||
*
|
||||
* @param {Command} cmd
|
||||
* @returns {Command[]}
|
||||
*/
|
||||
|
||||
visibleCommands(cmd) {
|
||||
const visibleCommands = cmd.commands.filter(cmd => !cmd._hidden);
|
||||
if (cmd._hasImplicitHelpCommand()) {
|
||||
// Create a command matching the implicit help command.
|
||||
const [, helpName, helpArgs] = cmd._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/);
|
||||
const helpCommand = cmd.createCommand(helpName)
|
||||
.helpOption(false);
|
||||
helpCommand.description(cmd._helpCommandDescription);
|
||||
if (helpArgs) helpCommand.arguments(helpArgs);
|
||||
visibleCommands.push(helpCommand);
|
||||
}
|
||||
if (this.sortSubcommands) {
|
||||
visibleCommands.sort((a, b) => {
|
||||
// @ts-ignore: overloaded return type
|
||||
return a.name().localeCompare(b.name());
|
||||
});
|
||||
}
|
||||
return visibleCommands;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare options for sort.
|
||||
*
|
||||
* @param {Option} a
|
||||
* @param {Option} b
|
||||
* @returns number
|
||||
*/
|
||||
compareOptions(a, b) {
|
||||
const getSortKey = (option) => {
|
||||
// WYSIWYG for order displayed in help. Short used for comparison if present. No special handling for negated.
|
||||
return option.short ? option.short.replace(/^-/, '') : option.long.replace(/^--/, '');
|
||||
};
|
||||
return getSortKey(a).localeCompare(getSortKey(b));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.
|
||||
*
|
||||
* @param {Command} cmd
|
||||
* @returns {Option[]}
|
||||
*/
|
||||
|
||||
visibleOptions(cmd) {
|
||||
const visibleOptions = cmd.options.filter((option) => !option.hidden);
|
||||
// Implicit help
|
||||
const showShortHelpFlag = cmd._hasHelpOption && cmd._helpShortFlag && !cmd._findOption(cmd._helpShortFlag);
|
||||
const showLongHelpFlag = cmd._hasHelpOption && !cmd._findOption(cmd._helpLongFlag);
|
||||
if (showShortHelpFlag || showLongHelpFlag) {
|
||||
let helpOption;
|
||||
if (!showShortHelpFlag) {
|
||||
helpOption = cmd.createOption(cmd._helpLongFlag, cmd._helpDescription);
|
||||
} else if (!showLongHelpFlag) {
|
||||
helpOption = cmd.createOption(cmd._helpShortFlag, cmd._helpDescription);
|
||||
} else {
|
||||
helpOption = cmd.createOption(cmd._helpFlags, cmd._helpDescription);
|
||||
}
|
||||
visibleOptions.push(helpOption);
|
||||
}
|
||||
if (this.sortOptions) {
|
||||
visibleOptions.sort(this.compareOptions);
|
||||
}
|
||||
return visibleOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an array of the visible global options. (Not including help.)
|
||||
*
|
||||
* @param {Command} cmd
|
||||
* @returns {Option[]}
|
||||
*/
|
||||
|
||||
visibleGlobalOptions(cmd) {
|
||||
if (!this.showGlobalOptions) return [];
|
||||
|
||||
const globalOptions = [];
|
||||
for (let parentCmd = cmd.parent; parentCmd; parentCmd = parentCmd.parent) {
|
||||
const visibleOptions = parentCmd.options.filter((option) => !option.hidden);
|
||||
globalOptions.push(...visibleOptions);
|
||||
}
|
||||
if (this.sortOptions) {
|
||||
globalOptions.sort(this.compareOptions);
|
||||
}
|
||||
return globalOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an array of the arguments if any have a description.
|
||||
*
|
||||
* @param {Command} cmd
|
||||
* @returns {Argument[]}
|
||||
*/
|
||||
|
||||
visibleArguments(cmd) {
|
||||
// Side effect! Apply the legacy descriptions before the arguments are displayed.
|
||||
if (cmd._argsDescription) {
|
||||
cmd._args.forEach(argument => {
|
||||
argument.description = argument.description || cmd._argsDescription[argument.name()] || '';
|
||||
});
|
||||
}
|
||||
|
||||
// If there are any arguments with a description then return all the arguments.
|
||||
if (cmd._args.find(argument => argument.description)) {
|
||||
return cmd._args;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the command term to show in the list of subcommands.
|
||||
*
|
||||
* @param {Command} cmd
|
||||
* @returns {string}
|
||||
*/
|
||||
|
||||
subcommandTerm(cmd) {
|
||||
// Legacy. Ignores custom usage string, and nested commands.
|
||||
const args = cmd._args.map(arg => humanReadableArgName(arg)).join(' ');
|
||||
return cmd._name +
|
||||
(cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +
|
||||
(cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option
|
||||
(args ? ' ' + args : '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the option term to show in the list of options.
|
||||
*
|
||||
* @param {Option} option
|
||||
* @returns {string}
|
||||
*/
|
||||
|
||||
optionTerm(option) {
|
||||
return option.flags;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the argument term to show in the list of arguments.
|
||||
*
|
||||
* @param {Argument} argument
|
||||
* @returns {string}
|
||||
*/
|
||||
|
||||
argumentTerm(argument) {
|
||||
return argument.name();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the longest command term length.
|
||||
*
|
||||
* @param {Command} cmd
|
||||
* @param {Help} helper
|
||||
* @returns {number}
|
||||
*/
|
||||
|
||||
longestSubcommandTermLength(cmd, helper) {
|
||||
return helper.visibleCommands(cmd).reduce((max, command) => {
|
||||
return Math.max(max, helper.subcommandTerm(command).length);
|
||||
}, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the longest option term length.
|
||||
*
|
||||
* @param {Command} cmd
|
||||
* @param {Help} helper
|
||||
* @returns {number}
|
||||
*/
|
||||
|
||||
longestOptionTermLength(cmd, helper) {
|
||||
return helper.visibleOptions(cmd).reduce((max, option) => {
|
||||
return Math.max(max, helper.optionTerm(option).length);
|
||||
}, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the longest global option term length.
|
||||
*
|
||||
* @param {Command} cmd
|
||||
* @param {Help} helper
|
||||
* @returns {number}
|
||||
*/
|
||||
|
||||
longestGlobalOptionTermLength(cmd, helper) {
|
||||
return helper.visibleGlobalOptions(cmd).reduce((max, option) => {
|
||||
return Math.max(max, helper.optionTerm(option).length);
|
||||
}, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the longest argument term length.
|
||||
*
|
||||
* @param {Command} cmd
|
||||
* @param {Help} helper
|
||||
* @returns {number}
|
||||
*/
|
||||
|
||||
longestArgumentTermLength(cmd, helper) {
|
||||
return helper.visibleArguments(cmd).reduce((max, argument) => {
|
||||
return Math.max(max, helper.argumentTerm(argument).length);
|
||||
}, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the command usage to be displayed at the top of the built-in help.
|
||||
*
|
||||
* @param {Command} cmd
|
||||
* @returns {string}
|
||||
*/
|
||||
|
||||
commandUsage(cmd) {
|
||||
// Usage
|
||||
let cmdName = cmd._name;
|
||||
if (cmd._aliases[0]) {
|
||||
cmdName = cmdName + '|' + cmd._aliases[0];
|
||||
}
|
||||
let parentCmdNames = '';
|
||||
for (let parentCmd = cmd.parent; parentCmd; parentCmd = parentCmd.parent) {
|
||||
parentCmdNames = parentCmd.name() + ' ' + parentCmdNames;
|
||||
}
|
||||
return parentCmdNames + cmdName + ' ' + cmd.usage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the description for the command.
|
||||
*
|
||||
* @param {Command} cmd
|
||||
* @returns {string}
|
||||
*/
|
||||
|
||||
commandDescription(cmd) {
|
||||
// @ts-ignore: overloaded return type
|
||||
return cmd.description();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the subcommand summary to show in the list of subcommands.
|
||||
* (Fallback to description for backwards compatibility.)
|
||||
*
|
||||
* @param {Command} cmd
|
||||
* @returns {string}
|
||||
*/
|
||||
|
||||
subcommandDescription(cmd) {
|
||||
// @ts-ignore: overloaded return type
|
||||
return cmd.summary() || cmd.description();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the option description to show in the list of options.
|
||||
*
|
||||
* @param {Option} option
|
||||
* @return {string}
|
||||
*/
|
||||
|
||||
optionDescription(option) {
|
||||
const extraInfo = [];
|
||||
|
||||
if (option.argChoices) {
|
||||
extraInfo.push(
|
||||
// use stringify to match the display of the default value
|
||||
`choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`);
|
||||
}
|
||||
if (option.defaultValue !== undefined) {
|
||||
// default for boolean and negated more for programmer than end user,
|
||||
// but show true/false for boolean option as may be for hand-rolled env or config processing.
|
||||
const showDefault = option.required || option.optional ||
|
||||
(option.isBoolean() && typeof option.defaultValue === 'boolean');
|
||||
if (showDefault) {
|
||||
extraInfo.push(`default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`);
|
||||
}
|
||||
}
|
||||
// preset for boolean and negated are more for programmer than end user
|
||||
if (option.presetArg !== undefined && option.optional) {
|
||||
extraInfo.push(`preset: ${JSON.stringify(option.presetArg)}`);
|
||||
}
|
||||
if (option.envVar !== undefined) {
|
||||
extraInfo.push(`env: ${option.envVar}`);
|
||||
}
|
||||
if (extraInfo.length > 0) {
|
||||
return `${option.description} (${extraInfo.join(', ')})`;
|
||||
}
|
||||
|
||||
return option.description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the argument description to show in the list of arguments.
|
||||
*
|
||||
* @param {Argument} argument
|
||||
* @return {string}
|
||||
*/
|
||||
|
||||
argumentDescription(argument) {
|
||||
const extraInfo = [];
|
||||
if (argument.argChoices) {
|
||||
extraInfo.push(
|
||||
// use stringify to match the display of the default value
|
||||
`choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`);
|
||||
}
|
||||
if (argument.defaultValue !== undefined) {
|
||||
extraInfo.push(`default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`);
|
||||
}
|
||||
if (extraInfo.length > 0) {
|
||||
const extraDescripton = `(${extraInfo.join(', ')})`;
|
||||
if (argument.description) {
|
||||
return `${argument.description} ${extraDescripton}`;
|
||||
}
|
||||
return extraDescripton;
|
||||
}
|
||||
return argument.description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the built-in help text.
|
||||
*
|
||||
* @param {Command} cmd
|
||||
* @param {Help} helper
|
||||
* @returns {string}
|
||||
*/
|
||||
|
||||
formatHelp(cmd, helper) {
|
||||
const termWidth = helper.padWidth(cmd, helper);
|
||||
const helpWidth = helper.helpWidth || 80;
|
||||
const itemIndentWidth = 2;
|
||||
const itemSeparatorWidth = 2; // between term and description
|
||||
function formatItem(term, description) {
|
||||
if (description) {
|
||||
const fullText = `${term.padEnd(termWidth + itemSeparatorWidth)}${description}`;
|
||||
return helper.wrap(fullText, helpWidth - itemIndentWidth, termWidth + itemSeparatorWidth);
|
||||
}
|
||||
return term;
|
||||
}
|
||||
function formatList(textArray) {
|
||||
return textArray.join('\n').replace(/^/gm, ' '.repeat(itemIndentWidth));
|
||||
}
|
||||
|
||||
// Usage
|
||||
let output = [`Usage: ${helper.commandUsage(cmd)}`, ''];
|
||||
|
||||
// Description
|
||||
const commandDescription = helper.commandDescription(cmd);
|
||||
if (commandDescription.length > 0) {
|
||||
output = output.concat([commandDescription, '']);
|
||||
}
|
||||
|
||||
// Arguments
|
||||
const argumentList = helper.visibleArguments(cmd).map((argument) => {
|
||||
return formatItem(helper.argumentTerm(argument), helper.argumentDescription(argument));
|
||||
});
|
||||
if (argumentList.length > 0) {
|
||||
output = output.concat(['Arguments:', formatList(argumentList), '']);
|
||||
}
|
||||
|
||||
// Options
|
||||
const optionList = helper.visibleOptions(cmd).map((option) => {
|
||||
return formatItem(helper.optionTerm(option), helper.optionDescription(option));
|
||||
});
|
||||
if (optionList.length > 0) {
|
||||
output = output.concat(['Options:', formatList(optionList), '']);
|
||||
}
|
||||
|
||||
if (this.showGlobalOptions) {
|
||||
const globalOptionList = helper.visibleGlobalOptions(cmd).map((option) => {
|
||||
return formatItem(helper.optionTerm(option), helper.optionDescription(option));
|
||||
});
|
||||
if (globalOptionList.length > 0) {
|
||||
output = output.concat(['Global Options:', formatList(globalOptionList), '']);
|
||||
}
|
||||
}
|
||||
|
||||
// Commands
|
||||
const commandList = helper.visibleCommands(cmd).map((cmd) => {
|
||||
return formatItem(helper.subcommandTerm(cmd), helper.subcommandDescription(cmd));
|
||||
});
|
||||
if (commandList.length > 0) {
|
||||
output = output.concat(['Commands:', formatList(commandList), '']);
|
||||
}
|
||||
|
||||
return output.join('\n');
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the pad width from the maximum term length.
|
||||
*
|
||||
* @param {Command} cmd
|
||||
* @param {Help} helper
|
||||
* @returns {number}
|
||||
*/
|
||||
|
||||
padWidth(cmd, helper) {
|
||||
return Math.max(
|
||||
helper.longestOptionTermLength(cmd, helper),
|
||||
helper.longestGlobalOptionTermLength(cmd, helper),
|
||||
helper.longestSubcommandTermLength(cmd, helper),
|
||||
helper.longestArgumentTermLength(cmd, helper)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap the given string to width characters per line, with lines after the first indented.
|
||||
* Do not wrap if insufficient room for wrapping (minColumnWidth), or string is manually formatted.
|
||||
*
|
||||
* @param {string} str
|
||||
* @param {number} width
|
||||
* @param {number} indent
|
||||
* @param {number} [minColumnWidth=40]
|
||||
* @return {string}
|
||||
*
|
||||
*/
|
||||
|
||||
wrap(str, width, indent, minColumnWidth = 40) {
|
||||
// Detect manually wrapped and indented strings by searching for line breaks
|
||||
// followed by multiple spaces/tabs.
|
||||
if (str.match(/[\n]\s+/)) return str;
|
||||
// Do not wrap if not enough room for a wrapped column of text (as could end up with a word per line).
|
||||
const columnWidth = width - indent;
|
||||
if (columnWidth < minColumnWidth) return str;
|
||||
|
||||
const leadingStr = str.slice(0, indent);
|
||||
const columnText = str.slice(indent);
|
||||
|
||||
const indentString = ' '.repeat(indent);
|
||||
const regex = new RegExp('.{1,' + (columnWidth - 1) + '}([\\s\u200B]|$)|[^\\s\u200B]+?([\\s\u200B]|$)', 'g');
|
||||
const lines = columnText.match(regex) || [];
|
||||
return leadingStr + lines.map((line, i) => {
|
||||
if (line.slice(-1) === '\n') {
|
||||
line = line.slice(0, line.length - 1);
|
||||
}
|
||||
return ((i > 0) ? indentString : '') + line.trimRight();
|
||||
}).join('\n');
|
||||
}
|
||||
}
|
||||
|
||||
exports.Help = Help;
|
326
@capacitor/cli/node_modules/commander/lib/option.js
generated
vendored
Normal file
326
@capacitor/cli/node_modules/commander/lib/option.js
generated
vendored
Normal file
|
@ -0,0 +1,326 @@
|
|||
const { InvalidArgumentError } = require('./error.js');
|
||||
|
||||
// @ts-check
|
||||
|
||||
class Option {
|
||||
/**
|
||||
* Initialize a new `Option` with the given `flags` and `description`.
|
||||
*
|
||||
* @param {string} flags
|
||||
* @param {string} [description]
|
||||
*/
|
||||
|
||||
constructor(flags, description) {
|
||||
this.flags = flags;
|
||||
this.description = description || '';
|
||||
|
||||
this.required = flags.includes('<'); // A value must be supplied when the option is specified.
|
||||
this.optional = flags.includes('['); // A value is optional when the option is specified.
|
||||
// variadic test ignores <value,...> et al which might be used to describe custom splitting of single argument
|
||||
this.variadic = /\w\.\.\.[>\]]$/.test(flags); // The option can take multiple values.
|
||||
this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line.
|
||||
const optionFlags = splitOptionFlags(flags);
|
||||
this.short = optionFlags.shortFlag;
|
||||
this.long = optionFlags.longFlag;
|
||||
this.negate = false;
|
||||
if (this.long) {
|
||||
this.negate = this.long.startsWith('--no-');
|
||||
}
|
||||
this.defaultValue = undefined;
|
||||
this.defaultValueDescription = undefined;
|
||||
this.presetArg = undefined;
|
||||
this.envVar = undefined;
|
||||
this.parseArg = undefined;
|
||||
this.hidden = false;
|
||||
this.argChoices = undefined;
|
||||
this.conflictsWith = [];
|
||||
this.implied = undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the default value, and optionally supply the description to be displayed in the help.
|
||||
*
|
||||
* @param {any} value
|
||||
* @param {string} [description]
|
||||
* @return {Option}
|
||||
*/
|
||||
|
||||
default(value, description) {
|
||||
this.defaultValue = value;
|
||||
this.defaultValueDescription = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Preset to use when option used without option-argument, especially optional but also boolean and negated.
|
||||
* The custom processing (parseArg) is called.
|
||||
*
|
||||
* @example
|
||||
* new Option('--color').default('GREYSCALE').preset('RGB');
|
||||
* new Option('--donate [amount]').preset('20').argParser(parseFloat);
|
||||
*
|
||||
* @param {any} arg
|
||||
* @return {Option}
|
||||
*/
|
||||
|
||||
preset(arg) {
|
||||
this.presetArg = arg;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add option name(s) that conflict with this option.
|
||||
* An error will be displayed if conflicting options are found during parsing.
|
||||
*
|
||||
* @example
|
||||
* new Option('--rgb').conflicts('cmyk');
|
||||
* new Option('--js').conflicts(['ts', 'jsx']);
|
||||
*
|
||||
* @param {string | string[]} names
|
||||
* @return {Option}
|
||||
*/
|
||||
|
||||
conflicts(names) {
|
||||
this.conflictsWith = this.conflictsWith.concat(names);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify implied option values for when this option is set and the implied options are not.
|
||||
*
|
||||
* The custom processing (parseArg) is not called on the implied values.
|
||||
*
|
||||
* @example
|
||||
* program
|
||||
* .addOption(new Option('--log', 'write logging information to file'))
|
||||
* .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));
|
||||
*
|
||||
* @param {Object} impliedOptionValues
|
||||
* @return {Option}
|
||||
*/
|
||||
implies(impliedOptionValues) {
|
||||
this.implied = Object.assign(this.implied || {}, impliedOptionValues);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set environment variable to check for option value.
|
||||
*
|
||||
* An environment variable is only used if when processed the current option value is
|
||||
* undefined, or the source of the current value is 'default' or 'config' or 'env'.
|
||||
*
|
||||
* @param {string} name
|
||||
* @return {Option}
|
||||
*/
|
||||
|
||||
env(name) {
|
||||
this.envVar = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the custom handler for processing CLI option arguments into option values.
|
||||
*
|
||||
* @param {Function} [fn]
|
||||
* @return {Option}
|
||||
*/
|
||||
|
||||
argParser(fn) {
|
||||
this.parseArg = fn;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the option is mandatory and must have a value after parsing.
|
||||
*
|
||||
* @param {boolean} [mandatory=true]
|
||||
* @return {Option}
|
||||
*/
|
||||
|
||||
makeOptionMandatory(mandatory = true) {
|
||||
this.mandatory = !!mandatory;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide option in help.
|
||||
*
|
||||
* @param {boolean} [hide=true]
|
||||
* @return {Option}
|
||||
*/
|
||||
|
||||
hideHelp(hide = true) {
|
||||
this.hidden = !!hide;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @api private
|
||||
*/
|
||||
|
||||
_concatValue(value, previous) {
|
||||
if (previous === this.defaultValue || !Array.isArray(previous)) {
|
||||
return [value];
|
||||
}
|
||||
|
||||
return previous.concat(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Only allow option value to be one of choices.
|
||||
*
|
||||
* @param {string[]} values
|
||||
* @return {Option}
|
||||
*/
|
||||
|
||||
choices(values) {
|
||||
this.argChoices = values.slice();
|
||||
this.parseArg = (arg, previous) => {
|
||||
if (!this.argChoices.includes(arg)) {
|
||||
throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(', ')}.`);
|
||||
}
|
||||
if (this.variadic) {
|
||||
return this._concatValue(arg, previous);
|
||||
}
|
||||
return arg;
|
||||
};
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return option name.
|
||||
*
|
||||
* @return {string}
|
||||
*/
|
||||
|
||||
name() {
|
||||
if (this.long) {
|
||||
return this.long.replace(/^--/, '');
|
||||
}
|
||||
return this.short.replace(/^-/, '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return option name, in a camelcase format that can be used
|
||||
* as a object attribute key.
|
||||
*
|
||||
* @return {string}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
attributeName() {
|
||||
return camelcase(this.name().replace(/^no-/, ''));
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if `arg` matches the short or long flag.
|
||||
*
|
||||
* @param {string} arg
|
||||
* @return {boolean}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
is(arg) {
|
||||
return this.short === arg || this.long === arg;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether a boolean option.
|
||||
*
|
||||
* Options are one of boolean, negated, required argument, or optional argument.
|
||||
*
|
||||
* @return {boolean}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
isBoolean() {
|
||||
return !this.required && !this.optional && !this.negate;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This class is to make it easier to work with dual options, without changing the existing
|
||||
* implementation. We support separate dual options for separate positive and negative options,
|
||||
* like `--build` and `--no-build`, which share a single option value. This works nicely for some
|
||||
* use cases, but is tricky for others where we want separate behaviours despite
|
||||
* the single shared option value.
|
||||
*/
|
||||
class DualOptions {
|
||||
/**
|
||||
* @param {Option[]} options
|
||||
*/
|
||||
constructor(options) {
|
||||
this.positiveOptions = new Map();
|
||||
this.negativeOptions = new Map();
|
||||
this.dualOptions = new Set();
|
||||
options.forEach(option => {
|
||||
if (option.negate) {
|
||||
this.negativeOptions.set(option.attributeName(), option);
|
||||
} else {
|
||||
this.positiveOptions.set(option.attributeName(), option);
|
||||
}
|
||||
});
|
||||
this.negativeOptions.forEach((value, key) => {
|
||||
if (this.positiveOptions.has(key)) {
|
||||
this.dualOptions.add(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Did the value come from the option, and not from possible matching dual option?
|
||||
*
|
||||
* @param {any} value
|
||||
* @param {Option} option
|
||||
* @returns {boolean}
|
||||
*/
|
||||
valueFromOption(value, option) {
|
||||
const optionKey = option.attributeName();
|
||||
if (!this.dualOptions.has(optionKey)) return true;
|
||||
|
||||
// Use the value to deduce if (probably) came from the option.
|
||||
const preset = this.negativeOptions.get(optionKey).presetArg;
|
||||
const negativeValue = (preset !== undefined) ? preset : false;
|
||||
return option.negate === (negativeValue === value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert string from kebab-case to camelCase.
|
||||
*
|
||||
* @param {string} str
|
||||
* @return {string}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function camelcase(str) {
|
||||
return str.split('-').reduce((str, word) => {
|
||||
return str + word[0].toUpperCase() + word.slice(1);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Split the short and long flag out of something like '-m,--mixed <value>'
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function splitOptionFlags(flags) {
|
||||
let shortFlag;
|
||||
let longFlag;
|
||||
// Use original very loose parsing to maintain backwards compatibility for now,
|
||||
// which allowed for example unintended `-sw, --short-word` [sic].
|
||||
const flagParts = flags.split(/[ |,]+/);
|
||||
if (flagParts.length > 1 && !/^[[<]/.test(flagParts[1])) shortFlag = flagParts.shift();
|
||||
longFlag = flagParts.shift();
|
||||
// Add support for lone short flag without significantly changing parsing!
|
||||
if (!shortFlag && /^-[^-]$/.test(longFlag)) {
|
||||
shortFlag = longFlag;
|
||||
longFlag = undefined;
|
||||
}
|
||||
return { shortFlag, longFlag };
|
||||
}
|
||||
|
||||
exports.Option = Option;
|
||||
exports.splitOptionFlags = splitOptionFlags;
|
||||
exports.DualOptions = DualOptions;
|
100
@capacitor/cli/node_modules/commander/lib/suggestSimilar.js
generated
vendored
Normal file
100
@capacitor/cli/node_modules/commander/lib/suggestSimilar.js
generated
vendored
Normal file
|
@ -0,0 +1,100 @@
|
|||
const maxDistance = 3;
|
||||
|
||||
function editDistance(a, b) {
|
||||
// https://en.wikipedia.org/wiki/Damerau–Levenshtein_distance
|
||||
// Calculating optimal string alignment distance, no substring is edited more than once.
|
||||
// (Simple implementation.)
|
||||
|
||||
// Quick early exit, return worst case.
|
||||
if (Math.abs(a.length - b.length) > maxDistance) return Math.max(a.length, b.length);
|
||||
|
||||
// distance between prefix substrings of a and b
|
||||
const d = [];
|
||||
|
||||
// pure deletions turn a into empty string
|
||||
for (let i = 0; i <= a.length; i++) {
|
||||
d[i] = [i];
|
||||
}
|
||||
// pure insertions turn empty string into b
|
||||
for (let j = 0; j <= b.length; j++) {
|
||||
d[0][j] = j;
|
||||
}
|
||||
|
||||
// fill matrix
|
||||
for (let j = 1; j <= b.length; j++) {
|
||||
for (let i = 1; i <= a.length; i++) {
|
||||
let cost = 1;
|
||||
if (a[i - 1] === b[j - 1]) {
|
||||
cost = 0;
|
||||
} else {
|
||||
cost = 1;
|
||||
}
|
||||
d[i][j] = Math.min(
|
||||
d[i - 1][j] + 1, // deletion
|
||||
d[i][j - 1] + 1, // insertion
|
||||
d[i - 1][j - 1] + cost // substitution
|
||||
);
|
||||
// transposition
|
||||
if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {
|
||||
d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return d[a.length][b.length];
|
||||
}
|
||||
|
||||
/**
|
||||
* Find close matches, restricted to same number of edits.
|
||||
*
|
||||
* @param {string} word
|
||||
* @param {string[]} candidates
|
||||
* @returns {string}
|
||||
*/
|
||||
|
||||
function suggestSimilar(word, candidates) {
|
||||
if (!candidates || candidates.length === 0) return '';
|
||||
// remove possible duplicates
|
||||
candidates = Array.from(new Set(candidates));
|
||||
|
||||
const searchingOptions = word.startsWith('--');
|
||||
if (searchingOptions) {
|
||||
word = word.slice(2);
|
||||
candidates = candidates.map(candidate => candidate.slice(2));
|
||||
}
|
||||
|
||||
let similar = [];
|
||||
let bestDistance = maxDistance;
|
||||
const minSimilarity = 0.4;
|
||||
candidates.forEach((candidate) => {
|
||||
if (candidate.length <= 1) return; // no one character guesses
|
||||
|
||||
const distance = editDistance(word, candidate);
|
||||
const length = Math.max(word.length, candidate.length);
|
||||
const similarity = (length - distance) / length;
|
||||
if (similarity > minSimilarity) {
|
||||
if (distance < bestDistance) {
|
||||
// better edit distance, throw away previous worse matches
|
||||
bestDistance = distance;
|
||||
similar = [candidate];
|
||||
} else if (distance === bestDistance) {
|
||||
similar.push(candidate);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
similar.sort((a, b) => a.localeCompare(b));
|
||||
if (searchingOptions) {
|
||||
similar = similar.map(candidate => `--${candidate}`);
|
||||
}
|
||||
|
||||
if (similar.length > 1) {
|
||||
return `\n(Did you mean one of ${similar.join(', ')}?)`;
|
||||
}
|
||||
if (similar.length === 1) {
|
||||
return `\n(Did you mean ${similar[0]}?)`;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
exports.suggestSimilar = suggestSimilar;
|
16
@capacitor/cli/node_modules/commander/package-support.json
generated
vendored
Normal file
16
@capacitor/cli/node_modules/commander/package-support.json
generated
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"versions": [
|
||||
{
|
||||
"version": "*",
|
||||
"target": {
|
||||
"node": "supported"
|
||||
},
|
||||
"response": {
|
||||
"type": "time-permitting"
|
||||
},
|
||||
"backing": {
|
||||
"npm-funding": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
80
@capacitor/cli/node_modules/commander/package.json
generated
vendored
Normal file
80
@capacitor/cli/node_modules/commander/package.json
generated
vendored
Normal file
|
@ -0,0 +1,80 @@
|
|||
{
|
||||
"name": "commander",
|
||||
"version": "9.5.0",
|
||||
"description": "the complete solution for node.js command-line programs",
|
||||
"keywords": [
|
||||
"commander",
|
||||
"command",
|
||||
"option",
|
||||
"parser",
|
||||
"cli",
|
||||
"argument",
|
||||
"args",
|
||||
"argv"
|
||||
],
|
||||
"author": "TJ Holowaychuk <tj@vision-media.ca>",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/tj/commander.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "npm run lint:javascript && npm run lint:typescript",
|
||||
"lint:javascript": "eslint index.js esm.mjs \"lib/*.js\" \"tests/**/*.js\"",
|
||||
"lint:typescript": "eslint typings/*.ts tests/*.ts",
|
||||
"test": "jest && npm run test-typings",
|
||||
"test-esm": "node --experimental-modules ./tests/esm-imports-test.mjs",
|
||||
"test-typings": "tsd",
|
||||
"typescript-checkJS": "tsc --allowJS --checkJS index.js lib/*.js --noEmit",
|
||||
"test-all": "npm run test && npm run lint && npm run typescript-checkJS && npm run test-esm"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"lib/*.js",
|
||||
"esm.mjs",
|
||||
"typings/index.d.ts",
|
||||
"package-support.json"
|
||||
],
|
||||
"type": "commonjs",
|
||||
"main": "./index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./typings/index.d.ts",
|
||||
"require": "./index.js",
|
||||
"import": "./esm.mjs"
|
||||
},
|
||||
"./esm.mjs": "./esm.mjs"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^28.1.4",
|
||||
"@types/node": "^16.11.15",
|
||||
"@typescript-eslint/eslint-plugin": "^5.30.6",
|
||||
"@typescript-eslint/parser": "^5.30.6",
|
||||
"eslint": "^8.19.0",
|
||||
"eslint-config-standard": "^17.0.0",
|
||||
"eslint-config-standard-with-typescript": "^22.0.0",
|
||||
"eslint-plugin-import": "^2.25.3",
|
||||
"eslint-plugin-jest": "^26.5.3",
|
||||
"eslint-plugin-n": "^15.2.4",
|
||||
"eslint-plugin-promise": "^6.0.0",
|
||||
"jest": "^28.1.2",
|
||||
"ts-jest": "^28.0.5",
|
||||
"tsd": "^0.22.0",
|
||||
"typescript": "^4.7.4"
|
||||
},
|
||||
"types": "typings/index.d.ts",
|
||||
"jest": {
|
||||
"testEnvironment": "node",
|
||||
"collectCoverage": true,
|
||||
"transform": {
|
||||
"^.+\\.tsx?$": "ts-jest"
|
||||
},
|
||||
"testPathIgnorePatterns": [
|
||||
"/node_modules/"
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.20.0 || >=14"
|
||||
},
|
||||
"support": true
|
||||
}
|
891
@capacitor/cli/node_modules/commander/typings/index.d.ts
generated
vendored
Normal file
891
@capacitor/cli/node_modules/commander/typings/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,891 @@
|
|||
// Type definitions for commander
|
||||
// Original definitions by: Alan Agius <https://github.com/alan-agius4>, Marcelo Dezem <https://github.com/mdezem>, vvakame <https://github.com/vvakame>, Jules Randolph <https://github.com/sveinburne>
|
||||
|
||||
// Using method rather than property for method-signature-style, to document method overloads separately. Allow either.
|
||||
/* eslint-disable @typescript-eslint/method-signature-style */
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
|
||||
export class CommanderError extends Error {
|
||||
code: string;
|
||||
exitCode: number;
|
||||
message: string;
|
||||
nestedError?: string;
|
||||
|
||||
/**
|
||||
* Constructs the CommanderError class
|
||||
* @param exitCode - suggested exit code which could be used with process.exit
|
||||
* @param code - an id string representing the error
|
||||
* @param message - human-readable description of the error
|
||||
* @constructor
|
||||
*/
|
||||
constructor(exitCode: number, code: string, message: string);
|
||||
}
|
||||
|
||||
export class InvalidArgumentError extends CommanderError {
|
||||
/**
|
||||
* Constructs the InvalidArgumentError class
|
||||
* @param message - explanation of why argument is invalid
|
||||
* @constructor
|
||||
*/
|
||||
constructor(message: string);
|
||||
}
|
||||
export { InvalidArgumentError as InvalidOptionArgumentError }; // deprecated old name
|
||||
|
||||
export interface ErrorOptions { // optional parameter for error()
|
||||
/** an id string representing the error */
|
||||
code?: string;
|
||||
/** suggested exit code which could be used with process.exit */
|
||||
exitCode?: number;
|
||||
}
|
||||
|
||||
export class Argument {
|
||||
description: string;
|
||||
required: boolean;
|
||||
variadic: boolean;
|
||||
|
||||
/**
|
||||
* Initialize a new command argument with the given name and description.
|
||||
* The default is that the argument is required, and you can explicitly
|
||||
* indicate this with <> around the name. Put [] around the name for an optional argument.
|
||||
*/
|
||||
constructor(arg: string, description?: string);
|
||||
|
||||
/**
|
||||
* Return argument name.
|
||||
*/
|
||||
name(): string;
|
||||
|
||||
/**
|
||||
* Set the default value, and optionally supply the description to be displayed in the help.
|
||||
*/
|
||||
default(value: unknown, description?: string): this;
|
||||
|
||||
/**
|
||||
* Set the custom handler for processing CLI command arguments into argument values.
|
||||
*/
|
||||
argParser<T>(fn: (value: string, previous: T) => T): this;
|
||||
|
||||
/**
|
||||
* Only allow argument value to be one of choices.
|
||||
*/
|
||||
choices(values: readonly string[]): this;
|
||||
|
||||
/**
|
||||
* Make argument required.
|
||||
*/
|
||||
argRequired(): this;
|
||||
|
||||
/**
|
||||
* Make argument optional.
|
||||
*/
|
||||
argOptional(): this;
|
||||
}
|
||||
|
||||
export class Option {
|
||||
flags: string;
|
||||
description: string;
|
||||
|
||||
required: boolean; // A value must be supplied when the option is specified.
|
||||
optional: boolean; // A value is optional when the option is specified.
|
||||
variadic: boolean;
|
||||
mandatory: boolean; // The option must have a value after parsing, which usually means it must be specified on command line.
|
||||
optionFlags: string;
|
||||
short?: string;
|
||||
long?: string;
|
||||
negate: boolean;
|
||||
defaultValue?: any;
|
||||
defaultValueDescription?: string;
|
||||
parseArg?: <T>(value: string, previous: T) => T;
|
||||
hidden: boolean;
|
||||
argChoices?: string[];
|
||||
|
||||
constructor(flags: string, description?: string);
|
||||
|
||||
/**
|
||||
* Set the default value, and optionally supply the description to be displayed in the help.
|
||||
*/
|
||||
default(value: unknown, description?: string): this;
|
||||
|
||||
/**
|
||||
* Preset to use when option used without option-argument, especially optional but also boolean and negated.
|
||||
* The custom processing (parseArg) is called.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* new Option('--color').default('GREYSCALE').preset('RGB');
|
||||
* new Option('--donate [amount]').preset('20').argParser(parseFloat);
|
||||
* ```
|
||||
*/
|
||||
preset(arg: unknown): this;
|
||||
|
||||
/**
|
||||
* Add option name(s) that conflict with this option.
|
||||
* An error will be displayed if conflicting options are found during parsing.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* new Option('--rgb').conflicts('cmyk');
|
||||
* new Option('--js').conflicts(['ts', 'jsx']);
|
||||
* ```
|
||||
*/
|
||||
conflicts(names: string | string[]): this;
|
||||
|
||||
/**
|
||||
* Specify implied option values for when this option is set and the implied options are not.
|
||||
*
|
||||
* The custom processing (parseArg) is not called on the implied values.
|
||||
*
|
||||
* @example
|
||||
* program
|
||||
* .addOption(new Option('--log', 'write logging information to file'))
|
||||
* .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));
|
||||
*/
|
||||
implies(optionValues: OptionValues): this;
|
||||
|
||||
/**
|
||||
* Set environment variable to check for option value.
|
||||
*
|
||||
* An environment variables is only used if when processed the current option value is
|
||||
* undefined, or the source of the current value is 'default' or 'config' or 'env'.
|
||||
*/
|
||||
env(name: string): this;
|
||||
|
||||
/**
|
||||
* Calculate the full description, including defaultValue etc.
|
||||
*/
|
||||
fullDescription(): string;
|
||||
|
||||
/**
|
||||
* Set the custom handler for processing CLI option arguments into option values.
|
||||
*/
|
||||
argParser<T>(fn: (value: string, previous: T) => T): this;
|
||||
|
||||
/**
|
||||
* Whether the option is mandatory and must have a value after parsing.
|
||||
*/
|
||||
makeOptionMandatory(mandatory?: boolean): this;
|
||||
|
||||
/**
|
||||
* Hide option in help.
|
||||
*/
|
||||
hideHelp(hide?: boolean): this;
|
||||
|
||||
/**
|
||||
* Only allow option value to be one of choices.
|
||||
*/
|
||||
choices(values: readonly string[]): this;
|
||||
|
||||
/**
|
||||
* Return option name.
|
||||
*/
|
||||
name(): string;
|
||||
|
||||
/**
|
||||
* Return option name, in a camelcase format that can be used
|
||||
* as a object attribute key.
|
||||
*/
|
||||
attributeName(): string;
|
||||
|
||||
/**
|
||||
* Return whether a boolean option.
|
||||
*
|
||||
* Options are one of boolean, negated, required argument, or optional argument.
|
||||
*/
|
||||
isBoolean(): boolean;
|
||||
}
|
||||
|
||||
export class Help {
|
||||
/** output helpWidth, long lines are wrapped to fit */
|
||||
helpWidth?: number;
|
||||
sortSubcommands: boolean;
|
||||
sortOptions: boolean;
|
||||
showGlobalOptions: boolean;
|
||||
|
||||
constructor();
|
||||
|
||||
/** Get the command term to show in the list of subcommands. */
|
||||
subcommandTerm(cmd: Command): string;
|
||||
/** Get the command summary to show in the list of subcommands. */
|
||||
subcommandDescription(cmd: Command): string;
|
||||
/** Get the option term to show in the list of options. */
|
||||
optionTerm(option: Option): string;
|
||||
/** Get the option description to show in the list of options. */
|
||||
optionDescription(option: Option): string;
|
||||
/** Get the argument term to show in the list of arguments. */
|
||||
argumentTerm(argument: Argument): string;
|
||||
/** Get the argument description to show in the list of arguments. */
|
||||
argumentDescription(argument: Argument): string;
|
||||
|
||||
/** Get the command usage to be displayed at the top of the built-in help. */
|
||||
commandUsage(cmd: Command): string;
|
||||
/** Get the description for the command. */
|
||||
commandDescription(cmd: Command): string;
|
||||
|
||||
/** Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one. */
|
||||
visibleCommands(cmd: Command): Command[];
|
||||
/** Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one. */
|
||||
visibleOptions(cmd: Command): Option[];
|
||||
/** Get an array of the visible global options. (Not including help.) */
|
||||
visibleGlobalOptions(cmd: Command): Option[];
|
||||
/** Get an array of the arguments which have descriptions. */
|
||||
visibleArguments(cmd: Command): Argument[];
|
||||
|
||||
/** Get the longest command term length. */
|
||||
longestSubcommandTermLength(cmd: Command, helper: Help): number;
|
||||
/** Get the longest option term length. */
|
||||
longestOptionTermLength(cmd: Command, helper: Help): number;
|
||||
/** Get the longest global option term length. */
|
||||
longestGlobalOptionTermLength(cmd: Command, helper: Help): number;
|
||||
/** Get the longest argument term length. */
|
||||
longestArgumentTermLength(cmd: Command, helper: Help): number;
|
||||
/** Calculate the pad width from the maximum term length. */
|
||||
padWidth(cmd: Command, helper: Help): number;
|
||||
|
||||
/**
|
||||
* Wrap the given string to width characters per line, with lines after the first indented.
|
||||
* Do not wrap if insufficient room for wrapping (minColumnWidth), or string is manually formatted.
|
||||
*/
|
||||
wrap(str: string, width: number, indent: number, minColumnWidth?: number): string;
|
||||
|
||||
/** Generate the built-in help text. */
|
||||
formatHelp(cmd: Command, helper: Help): string;
|
||||
}
|
||||
export type HelpConfiguration = Partial<Help>;
|
||||
|
||||
export interface ParseOptions {
|
||||
from: 'node' | 'electron' | 'user';
|
||||
}
|
||||
export interface HelpContext { // optional parameter for .help() and .outputHelp()
|
||||
error: boolean;
|
||||
}
|
||||
export interface AddHelpTextContext { // passed to text function used with .addHelpText()
|
||||
error: boolean;
|
||||
command: Command;
|
||||
}
|
||||
export interface OutputConfiguration {
|
||||
writeOut?(str: string): void;
|
||||
writeErr?(str: string): void;
|
||||
getOutHelpWidth?(): number;
|
||||
getErrHelpWidth?(): number;
|
||||
outputError?(str: string, write: (str: string) => void): void;
|
||||
|
||||
}
|
||||
|
||||
export type AddHelpTextPosition = 'beforeAll' | 'before' | 'after' | 'afterAll';
|
||||
export type HookEvent = 'preSubcommand' | 'preAction' | 'postAction';
|
||||
export type OptionValueSource = 'default' | 'config' | 'env' | 'cli' | 'implied';
|
||||
|
||||
export interface OptionValues {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export class Command {
|
||||
args: string[];
|
||||
processedArgs: any[];
|
||||
commands: Command[];
|
||||
parent: Command | null;
|
||||
|
||||
constructor(name?: string);
|
||||
|
||||
/**
|
||||
* Set the program version to `str`.
|
||||
*
|
||||
* This method auto-registers the "-V, --version" flag
|
||||
* which will print the version number when passed.
|
||||
*
|
||||
* You can optionally supply the flags and description to override the defaults.
|
||||
*/
|
||||
version(str: string, flags?: string, description?: string): this;
|
||||
|
||||
/**
|
||||
* Define a command, implemented using an action handler.
|
||||
*
|
||||
* @remarks
|
||||
* The command description is supplied using `.description`, not as a parameter to `.command`.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* program
|
||||
* .command('clone <source> [destination]')
|
||||
* .description('clone a repository into a newly created directory')
|
||||
* .action((source, destination) => {
|
||||
* console.log('clone command called');
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`
|
||||
* @param opts - configuration options
|
||||
* @returns new command
|
||||
*/
|
||||
command(nameAndArgs: string, opts?: CommandOptions): ReturnType<this['createCommand']>;
|
||||
/**
|
||||
* Define a command, implemented in a separate executable file.
|
||||
*
|
||||
* @remarks
|
||||
* The command description is supplied as the second parameter to `.command`.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* program
|
||||
* .command('start <service>', 'start named service')
|
||||
* .command('stop [service]', 'stop named service, or all if no name supplied');
|
||||
* ```
|
||||
*
|
||||
* @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`
|
||||
* @param description - description of executable command
|
||||
* @param opts - configuration options
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
command(nameAndArgs: string, description: string, opts?: ExecutableCommandOptions): this;
|
||||
|
||||
/**
|
||||
* Factory routine to create a new unattached command.
|
||||
*
|
||||
* See .command() for creating an attached subcommand, which uses this routine to
|
||||
* create the command. You can override createCommand to customise subcommands.
|
||||
*/
|
||||
createCommand(name?: string): Command;
|
||||
|
||||
/**
|
||||
* Add a prepared subcommand.
|
||||
*
|
||||
* See .command() for creating an attached subcommand which inherits settings from its parent.
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
addCommand(cmd: Command, opts?: CommandOptions): this;
|
||||
|
||||
/**
|
||||
* Factory routine to create a new unattached argument.
|
||||
*
|
||||
* See .argument() for creating an attached argument, which uses this routine to
|
||||
* create the argument. You can override createArgument to return a custom argument.
|
||||
*/
|
||||
createArgument(name: string, description?: string): Argument;
|
||||
|
||||
/**
|
||||
* Define argument syntax for command.
|
||||
*
|
||||
* The default is that the argument is required, and you can explicitly
|
||||
* indicate this with <> around the name. Put [] around the name for an optional argument.
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* program.argument('<input-file>');
|
||||
* program.argument('[output-file]');
|
||||
* ```
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
argument<T>(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this;
|
||||
argument(name: string, description?: string, defaultValue?: unknown): this;
|
||||
|
||||
/**
|
||||
* Define argument syntax for command, adding a prepared argument.
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
addArgument(arg: Argument): this;
|
||||
|
||||
/**
|
||||
* Define argument syntax for command, adding multiple at once (without descriptions).
|
||||
*
|
||||
* See also .argument().
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* program.arguments('<cmd> [env]');
|
||||
* ```
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
arguments(names: string): this;
|
||||
|
||||
/**
|
||||
* Override default decision whether to add implicit help command.
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* addHelpCommand() // force on
|
||||
* addHelpCommand(false); // force off
|
||||
* addHelpCommand('help [cmd]', 'display help for [cmd]'); // force on with custom details
|
||||
* ```
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
addHelpCommand(enableOrNameAndArgs?: string | boolean, description?: string): this;
|
||||
|
||||
/**
|
||||
* Add hook for life cycle event.
|
||||
*/
|
||||
hook(event: HookEvent, listener: (thisCommand: Command, actionCommand: Command) => void | Promise<void>): this;
|
||||
|
||||
/**
|
||||
* Register callback to use as replacement for calling process.exit.
|
||||
*/
|
||||
exitOverride(callback?: (err: CommanderError) => never | void): this;
|
||||
|
||||
/**
|
||||
* Display error message and exit (or call exitOverride).
|
||||
*/
|
||||
error(message: string, errorOptions?: ErrorOptions): never;
|
||||
|
||||
/**
|
||||
* You can customise the help with a subclass of Help by overriding createHelp,
|
||||
* or by overriding Help properties using configureHelp().
|
||||
*/
|
||||
createHelp(): Help;
|
||||
|
||||
/**
|
||||
* You can customise the help by overriding Help properties using configureHelp(),
|
||||
* or with a subclass of Help by overriding createHelp().
|
||||
*/
|
||||
configureHelp(configuration: HelpConfiguration): this;
|
||||
/** Get configuration */
|
||||
configureHelp(): HelpConfiguration;
|
||||
|
||||
/**
|
||||
* The default output goes to stdout and stderr. You can customise this for special
|
||||
* applications. You can also customise the display of errors by overriding outputError.
|
||||
*
|
||||
* The configuration properties are all functions:
|
||||
* ```
|
||||
* // functions to change where being written, stdout and stderr
|
||||
* writeOut(str)
|
||||
* writeErr(str)
|
||||
* // matching functions to specify width for wrapping help
|
||||
* getOutHelpWidth()
|
||||
* getErrHelpWidth()
|
||||
* // functions based on what is being written out
|
||||
* outputError(str, write) // used for displaying errors, and not used for displaying help
|
||||
* ```
|
||||
*/
|
||||
configureOutput(configuration: OutputConfiguration): this;
|
||||
/** Get configuration */
|
||||
configureOutput(): OutputConfiguration;
|
||||
|
||||
/**
|
||||
* Copy settings that are useful to have in common across root command and subcommands.
|
||||
*
|
||||
* (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)
|
||||
*/
|
||||
copyInheritedSettings(sourceCommand: Command): this;
|
||||
|
||||
/**
|
||||
* Display the help or a custom message after an error occurs.
|
||||
*/
|
||||
showHelpAfterError(displayHelp?: boolean | string): this;
|
||||
|
||||
/**
|
||||
* Display suggestion of similar commands for unknown commands, or options for unknown options.
|
||||
*/
|
||||
showSuggestionAfterError(displaySuggestion?: boolean): this;
|
||||
|
||||
/**
|
||||
* Register callback `fn` for the command.
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* program
|
||||
* .command('serve')
|
||||
* .description('start service')
|
||||
* .action(function() {
|
||||
* // do work here
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
action(fn: (...args: any[]) => void | Promise<void>): this;
|
||||
|
||||
/**
|
||||
* Define option with `flags`, `description` and optional
|
||||
* coercion `fn`.
|
||||
*
|
||||
* The `flags` string contains the short and/or long flags,
|
||||
* separated by comma, a pipe or space. The following are all valid
|
||||
* all will output this way when `--help` is used.
|
||||
*
|
||||
* "-p, --pepper"
|
||||
* "-p|--pepper"
|
||||
* "-p --pepper"
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* // simple boolean defaulting to false
|
||||
* program.option('-p, --pepper', 'add pepper');
|
||||
*
|
||||
* --pepper
|
||||
* program.pepper
|
||||
* // => Boolean
|
||||
*
|
||||
* // simple boolean defaulting to true
|
||||
* program.option('-C, --no-cheese', 'remove cheese');
|
||||
*
|
||||
* program.cheese
|
||||
* // => true
|
||||
*
|
||||
* --no-cheese
|
||||
* program.cheese
|
||||
* // => false
|
||||
*
|
||||
* // required argument
|
||||
* program.option('-C, --chdir <path>', 'change the working directory');
|
||||
*
|
||||
* --chdir /tmp
|
||||
* program.chdir
|
||||
* // => "/tmp"
|
||||
*
|
||||
* // optional argument
|
||||
* program.option('-c, --cheese [type]', 'add cheese [marble]');
|
||||
* ```
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
option(flags: string, description?: string, defaultValue?: string | boolean | string[]): this;
|
||||
option<T>(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this;
|
||||
/** @deprecated since v7, instead use choices or a custom function */
|
||||
option(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean | string[]): this;
|
||||
|
||||
/**
|
||||
* Define a required option, which must have a value after parsing. This usually means
|
||||
* the option must be specified on the command line. (Otherwise the same as .option().)
|
||||
*
|
||||
* The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.
|
||||
*/
|
||||
requiredOption(flags: string, description?: string, defaultValue?: string | boolean | string[]): this;
|
||||
requiredOption<T>(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this;
|
||||
/** @deprecated since v7, instead use choices or a custom function */
|
||||
requiredOption(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean | string[]): this;
|
||||
|
||||
/**
|
||||
* Factory routine to create a new unattached option.
|
||||
*
|
||||
* See .option() for creating an attached option, which uses this routine to
|
||||
* create the option. You can override createOption to return a custom option.
|
||||
*/
|
||||
|
||||
createOption(flags: string, description?: string): Option;
|
||||
|
||||
/**
|
||||
* Add a prepared Option.
|
||||
*
|
||||
* See .option() and .requiredOption() for creating and attaching an option in a single call.
|
||||
*/
|
||||
addOption(option: Option): this;
|
||||
|
||||
/**
|
||||
* Whether to store option values as properties on command object,
|
||||
* or store separately (specify false). In both cases the option values can be accessed using .opts().
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
storeOptionsAsProperties<T extends OptionValues>(): this & T;
|
||||
storeOptionsAsProperties<T extends OptionValues>(storeAsProperties: true): this & T;
|
||||
storeOptionsAsProperties(storeAsProperties?: boolean): this;
|
||||
|
||||
/**
|
||||
* Retrieve option value.
|
||||
*/
|
||||
getOptionValue(key: string): any;
|
||||
|
||||
/**
|
||||
* Store option value.
|
||||
*/
|
||||
setOptionValue(key: string, value: unknown): this;
|
||||
|
||||
/**
|
||||
* Store option value and where the value came from.
|
||||
*/
|
||||
setOptionValueWithSource(key: string, value: unknown, source: OptionValueSource): this;
|
||||
|
||||
/**
|
||||
* Get source of option value.
|
||||
*/
|
||||
getOptionValueSource(key: string): OptionValueSource | undefined;
|
||||
|
||||
/**
|
||||
* Get source of option value. See also .optsWithGlobals().
|
||||
*/
|
||||
getOptionValueSourceWithGlobals(key: string): OptionValueSource | undefined;
|
||||
|
||||
/**
|
||||
* Alter parsing of short flags with optional values.
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* // for `.option('-f,--flag [value]'):
|
||||
* .combineFlagAndOptionalValue(true) // `-f80` is treated like `--flag=80`, this is the default behaviour
|
||||
* .combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`
|
||||
* ```
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
combineFlagAndOptionalValue(combine?: boolean): this;
|
||||
|
||||
/**
|
||||
* Allow unknown options on the command line.
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
allowUnknownOption(allowUnknown?: boolean): this;
|
||||
|
||||
/**
|
||||
* Allow excess command-arguments on the command line. Pass false to make excess arguments an error.
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
allowExcessArguments(allowExcess?: boolean): this;
|
||||
|
||||
/**
|
||||
* Enable positional options. Positional means global options are specified before subcommands which lets
|
||||
* subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.
|
||||
*
|
||||
* The default behaviour is non-positional and global options may appear anywhere on the command line.
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
enablePositionalOptions(positional?: boolean): this;
|
||||
|
||||
/**
|
||||
* Pass through options that come after command-arguments rather than treat them as command-options,
|
||||
* so actual command-options come before command-arguments. Turning this on for a subcommand requires
|
||||
* positional options to have been enabled on the program (parent commands).
|
||||
*
|
||||
* The default behaviour is non-positional and options may appear before or after command-arguments.
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
passThroughOptions(passThrough?: boolean): this;
|
||||
|
||||
/**
|
||||
* Parse `argv`, setting options and invoking commands when defined.
|
||||
*
|
||||
* The default expectation is that the arguments are from node and have the application as argv[0]
|
||||
* and the script being run in argv[1], with user parameters after that.
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* program.parse(process.argv);
|
||||
* program.parse(); // implicitly use process.argv and auto-detect node vs electron conventions
|
||||
* program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
|
||||
* ```
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
parse(argv?: readonly string[], options?: ParseOptions): this;
|
||||
|
||||
/**
|
||||
* Parse `argv`, setting options and invoking commands when defined.
|
||||
*
|
||||
* Use parseAsync instead of parse if any of your action handlers are async. Returns a Promise.
|
||||
*
|
||||
* The default expectation is that the arguments are from node and have the application as argv[0]
|
||||
* and the script being run in argv[1], with user parameters after that.
|
||||
*
|
||||
* @example
|
||||
* ```
|
||||
* program.parseAsync(process.argv);
|
||||
* program.parseAsync(); // implicitly use process.argv and auto-detect node vs electron conventions
|
||||
* program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
|
||||
* ```
|
||||
*
|
||||
* @returns Promise
|
||||
*/
|
||||
parseAsync(argv?: readonly string[], options?: ParseOptions): Promise<this>;
|
||||
|
||||
/**
|
||||
* Parse options from `argv` removing known options,
|
||||
* and return argv split into operands and unknown arguments.
|
||||
*
|
||||
* argv => operands, unknown
|
||||
* --known kkk op => [op], []
|
||||
* op --known kkk => [op], []
|
||||
* sub --unknown uuu op => [sub], [--unknown uuu op]
|
||||
* sub -- --unknown uuu op => [sub --unknown uuu op], []
|
||||
*/
|
||||
parseOptions(argv: string[]): ParseOptionsResult;
|
||||
|
||||
/**
|
||||
* Return an object containing local option values as key-value pairs
|
||||
*/
|
||||
opts<T extends OptionValues>(): T;
|
||||
|
||||
/**
|
||||
* Return an object containing merged local and global option values as key-value pairs.
|
||||
*/
|
||||
optsWithGlobals<T extends OptionValues>(): T;
|
||||
|
||||
/**
|
||||
* Set the description.
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
|
||||
description(str: string): this;
|
||||
/** @deprecated since v8, instead use .argument to add command argument with description */
|
||||
description(str: string, argsDescription: {[argName: string]: string}): this;
|
||||
/**
|
||||
* Get the description.
|
||||
*/
|
||||
description(): string;
|
||||
|
||||
/**
|
||||
* Set the summary. Used when listed as subcommand of parent.
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
|
||||
summary(str: string): this;
|
||||
/**
|
||||
* Get the summary.
|
||||
*/
|
||||
summary(): string;
|
||||
|
||||
/**
|
||||
* Set an alias for the command.
|
||||
*
|
||||
* You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
alias(alias: string): this;
|
||||
/**
|
||||
* Get alias for the command.
|
||||
*/
|
||||
alias(): string;
|
||||
|
||||
/**
|
||||
* Set aliases for the command.
|
||||
*
|
||||
* Only the first alias is shown in the auto-generated help.
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
aliases(aliases: readonly string[]): this;
|
||||
/**
|
||||
* Get aliases for the command.
|
||||
*/
|
||||
aliases(): string[];
|
||||
|
||||
/**
|
||||
* Set the command usage.
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
usage(str: string): this;
|
||||
/**
|
||||
* Get the command usage.
|
||||
*/
|
||||
usage(): string;
|
||||
|
||||
/**
|
||||
* Set the name of the command.
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
name(str: string): this;
|
||||
/**
|
||||
* Get the name of the command.
|
||||
*/
|
||||
name(): string;
|
||||
|
||||
/**
|
||||
* Set the name of the command from script filename, such as process.argv[1],
|
||||
* or require.main.filename, or __filename.
|
||||
*
|
||||
* (Used internally and public although not documented in README.)
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* program.nameFromFilename(require.main.filename);
|
||||
* ```
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
nameFromFilename(filename: string): this;
|
||||
|
||||
/**
|
||||
* Set the directory for searching for executable subcommands of this command.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* program.executableDir(__dirname);
|
||||
* // or
|
||||
* program.executableDir('subcommands');
|
||||
* ```
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
executableDir(path: string): this;
|
||||
/**
|
||||
* Get the executable search directory.
|
||||
*/
|
||||
executableDir(): string;
|
||||
|
||||
/**
|
||||
* Output help information for this command.
|
||||
*
|
||||
* Outputs built-in help, and custom text added using `.addHelpText()`.
|
||||
*
|
||||
*/
|
||||
outputHelp(context?: HelpContext): void;
|
||||
/** @deprecated since v7 */
|
||||
outputHelp(cb?: (str: string) => string): void;
|
||||
|
||||
/**
|
||||
* Return command help documentation.
|
||||
*/
|
||||
helpInformation(context?: HelpContext): string;
|
||||
|
||||
/**
|
||||
* You can pass in flags and a description to override the help
|
||||
* flags and help description for your command. Pass in false
|
||||
* to disable the built-in help option.
|
||||
*/
|
||||
helpOption(flags?: string | boolean, description?: string): this;
|
||||
|
||||
/**
|
||||
* Output help information and exit.
|
||||
*
|
||||
* Outputs built-in help, and custom text added using `.addHelpText()`.
|
||||
*/
|
||||
help(context?: HelpContext): never;
|
||||
/** @deprecated since v7 */
|
||||
help(cb?: (str: string) => string): never;
|
||||
|
||||
/**
|
||||
* Add additional text to be displayed with the built-in help.
|
||||
*
|
||||
* Position is 'before' or 'after' to affect just this command,
|
||||
* and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.
|
||||
*/
|
||||
addHelpText(position: AddHelpTextPosition, text: string): this;
|
||||
addHelpText(position: AddHelpTextPosition, text: (context: AddHelpTextContext) => string): this;
|
||||
|
||||
/**
|
||||
* Add a listener (callback) for when events occur. (Implemented using EventEmitter.)
|
||||
*/
|
||||
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
}
|
||||
|
||||
export interface CommandOptions {
|
||||
hidden?: boolean;
|
||||
isDefault?: boolean;
|
||||
/** @deprecated since v7, replaced by hidden */
|
||||
noHelp?: boolean;
|
||||
}
|
||||
export interface ExecutableCommandOptions extends CommandOptions {
|
||||
executableFile?: string;
|
||||
}
|
||||
|
||||
export interface ParseOptionsResult {
|
||||
operands: string[];
|
||||
unknown: string[];
|
||||
}
|
||||
|
||||
export function createCommand(name?: string): Command;
|
||||
export function createOption(flags: string, description?: string): Option;
|
||||
export function createArgument(name: string, description?: string): Argument;
|
||||
|
||||
export const program: Command;
|
15
@capacitor/cli/node_modules/glob/LICENSE
generated
vendored
Normal file
15
@capacitor/cli/node_modules/glob/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
The ISC License
|
||||
|
||||
Copyright (c) 2009-2023 Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
1086
@capacitor/cli/node_modules/glob/README.md
generated
vendored
Normal file
1086
@capacitor/cli/node_modules/glob/README.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
333
@capacitor/cli/node_modules/glob/dist/cjs/glob.d.ts
generated
vendored
Normal file
333
@capacitor/cli/node_modules/glob/dist/cjs/glob.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,333 @@
|
|||
/// <reference types="node" />
|
||||
import { Minimatch } from 'minimatch';
|
||||
import Minipass from 'minipass';
|
||||
import { FSOption, Path, PathScurry } from 'path-scurry';
|
||||
import { IgnoreLike } from './ignore.js';
|
||||
import { Pattern } from './pattern.js';
|
||||
export type MatchSet = Minimatch['set'];
|
||||
export type GlobParts = Exclude<Minimatch['globParts'], undefined>;
|
||||
/**
|
||||
* A `GlobOptions` object may be provided to any of the exported methods, and
|
||||
* must be provided to the `Glob` constructor.
|
||||
*
|
||||
* All options are optional, boolean, and false by default, unless otherwise
|
||||
* noted.
|
||||
*
|
||||
* All resolved options are added to the Glob object as properties.
|
||||
*
|
||||
* If you are running many `glob` operations, you can pass a Glob object as the
|
||||
* `options` argument to a subsequent operation to share the previously loaded
|
||||
* cache.
|
||||
*/
|
||||
export interface GlobOptions {
|
||||
/**
|
||||
* Set to `true` to always receive absolute paths for
|
||||
* matched files. Set to `false` to always return relative paths.
|
||||
*
|
||||
* When this option is not set, absolute paths are returned for patterns
|
||||
* that are absolute, and otherwise paths are returned that are relative
|
||||
* to the `cwd` setting.
|
||||
*
|
||||
* This does _not_ make an extra system call to get
|
||||
* the realpath, it only does string path resolution.
|
||||
*
|
||||
* Conflicts with {@link withFileTypes}
|
||||
*/
|
||||
absolute?: boolean;
|
||||
/**
|
||||
* Set to false to enable {@link windowsPathsNoEscape}
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
allowWindowsEscape?: boolean;
|
||||
/**
|
||||
* The current working directory in which to search. Defaults to
|
||||
* `process.cwd()`.
|
||||
*
|
||||
* May be eiher a string path or a `file://` URL object or string.
|
||||
*/
|
||||
cwd?: string | URL;
|
||||
/**
|
||||
* Include `.dot` files in normal matches and `globstar`
|
||||
* matches. Note that an explicit dot in a portion of the pattern
|
||||
* will always match dot files.
|
||||
*/
|
||||
dot?: boolean;
|
||||
/**
|
||||
* Prepend all relative path strings with `./` (or `.\` on Windows).
|
||||
*
|
||||
* Without this option, returned relative paths are "bare", so instead of
|
||||
* returning `'./foo/bar'`, they are returned as `'foo/bar'`.
|
||||
*
|
||||
* Relative patterns starting with `'../'` are not prepended with `./`, even
|
||||
* if this option is set.
|
||||
*/
|
||||
dotRelative?: boolean;
|
||||
/**
|
||||
* Follow symlinked directories when expanding `**`
|
||||
* patterns. This can result in a lot of duplicate references in
|
||||
* the presence of cyclic links, and make performance quite bad.
|
||||
*
|
||||
* By default, a `**` in a pattern will follow 1 symbolic link if
|
||||
* it is not the first item in the pattern, or none if it is the
|
||||
* first item in the pattern, following the same behavior as Bash.
|
||||
*/
|
||||
follow?: boolean;
|
||||
/**
|
||||
* string or string[], or an object with `ignore` and `ignoreChildren`
|
||||
* methods.
|
||||
*
|
||||
* If a string or string[] is provided, then this is treated as a glob
|
||||
* pattern or array of glob patterns to exclude from matches. To ignore all
|
||||
* children within a directory, as well as the entry itself, append `'/**'`
|
||||
* to the ignore pattern.
|
||||
*
|
||||
* **Note** `ignore` patterns are _always_ in `dot:true` mode, regardless of
|
||||
* any other settings.
|
||||
*
|
||||
* If an object is provided that has `ignored(path)` and/or
|
||||
* `childrenIgnored(path)` methods, then these methods will be called to
|
||||
* determine whether any Path is a match or if its children should be
|
||||
* traversed, respectively.
|
||||
*/
|
||||
ignore?: string | string[] | IgnoreLike;
|
||||
/**
|
||||
* Treat brace expansion like `{a,b}` as a "magic" pattern. Has no
|
||||
* effect if {@link nobrace} is set.
|
||||
*
|
||||
* Only has effect on the {@link hasMagic} function.
|
||||
*/
|
||||
magicalBraces?: boolean;
|
||||
/**
|
||||
* Add a `/` character to directory matches. Note that this requires
|
||||
* additional stat calls in some cases.
|
||||
*/
|
||||
mark?: boolean;
|
||||
/**
|
||||
* Perform a basename-only match if the pattern does not contain any slash
|
||||
* characters. That is, `*.js` would be treated as equivalent to
|
||||
* `**\/*.js`, matching all js files in all directories.
|
||||
*/
|
||||
matchBase?: boolean;
|
||||
/**
|
||||
* Limit the directory traversal to a given depth below the cwd.
|
||||
* Note that this does NOT prevent traversal to sibling folders,
|
||||
* root patterns, and so on. It only limits the maximum folder depth
|
||||
* that the walk will descend, relative to the cwd.
|
||||
*/
|
||||
maxDepth?: number;
|
||||
/**
|
||||
* Do not expand `{a,b}` and `{1..3}` brace sets.
|
||||
*/
|
||||
nobrace?: boolean;
|
||||
/**
|
||||
* Perform a case-insensitive match. This defaults to `true` on macOS and
|
||||
* Windows systems, and `false` on all others.
|
||||
*
|
||||
* **Note** `nocase` should only be explicitly set when it is
|
||||
* known that the filesystem's case sensitivity differs from the
|
||||
* platform default. If set `true` on case-sensitive file
|
||||
* systems, or `false` on case-insensitive file systems, then the
|
||||
* walk may return more or less results than expected.
|
||||
*/
|
||||
nocase?: boolean;
|
||||
/**
|
||||
* Do not match directories, only files. (Note: to match
|
||||
* _only_ directories, put a `/` at the end of the pattern.)
|
||||
*/
|
||||
nodir?: boolean;
|
||||
/**
|
||||
* Do not match "extglob" patterns such as `+(a|b)`.
|
||||
*/
|
||||
noext?: boolean;
|
||||
/**
|
||||
* Do not match `**` against multiple filenames. (Ie, treat it as a normal
|
||||
* `*` instead.)
|
||||
*
|
||||
* Conflicts with {@link matchBase}
|
||||
*/
|
||||
noglobstar?: boolean;
|
||||
/**
|
||||
* Defaults to value of `process.platform` if available, or `'linux'` if
|
||||
* not. Setting `platform:'win32'` on non-Windows systems may cause strange
|
||||
* behavior.
|
||||
*/
|
||||
platform?: NodeJS.Platform;
|
||||
/**
|
||||
* Set to true to call `fs.realpath` on all of the
|
||||
* results. In the case of an entry that cannot be resolved, the
|
||||
* entry is omitted. This incurs a slight performance penalty, of
|
||||
* course, because of the added system calls.
|
||||
*/
|
||||
realpath?: boolean;
|
||||
/**
|
||||
*
|
||||
* A string path resolved against the `cwd` option, which
|
||||
* is used as the starting point for absolute patterns that start
|
||||
* with `/`, (but not drive letters or UNC paths on Windows).
|
||||
*
|
||||
* Note that this _doesn't_ necessarily limit the walk to the
|
||||
* `root` directory, and doesn't affect the cwd starting point for
|
||||
* non-absolute patterns. A pattern containing `..` will still be
|
||||
* able to traverse out of the root directory, if it is not an
|
||||
* actual root directory on the filesystem, and any non-absolute
|
||||
* patterns will be matched in the `cwd`. For example, the
|
||||
* pattern `/../*` with `{root:'/some/path'}` will return all
|
||||
* files in `/some`, not all files in `/some/path`. The pattern
|
||||
* `*` with `{root:'/some/path'}` will return all the entries in
|
||||
* the cwd, not the entries in `/some/path`.
|
||||
*
|
||||
* To start absolute and non-absolute patterns in the same
|
||||
* path, you can use `{root:''}`. However, be aware that on
|
||||
* Windows systems, a pattern like `x:/*` or `//host/share/*` will
|
||||
* _always_ start in the `x:/` or `//host/share` directory,
|
||||
* regardless of the `root` setting.
|
||||
*/
|
||||
root?: string;
|
||||
/**
|
||||
* A [PathScurry](http://npm.im/path-scurry) object used
|
||||
* to traverse the file system. If the `nocase` option is set
|
||||
* explicitly, then any provided `scurry` object must match this
|
||||
* setting.
|
||||
*/
|
||||
scurry?: PathScurry;
|
||||
/**
|
||||
* Call `lstat()` on all entries, whether required or not to determine
|
||||
* whether it's a valid match. When used with {@link withFileTypes}, this
|
||||
* means that matches will include data such as modified time, permissions,
|
||||
* and so on. Note that this will incur a performance cost due to the added
|
||||
* system calls.
|
||||
*/
|
||||
stat?: boolean;
|
||||
/**
|
||||
* An AbortSignal which will cancel the Glob walk when
|
||||
* triggered.
|
||||
*/
|
||||
signal?: AbortSignal;
|
||||
/**
|
||||
* 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 Glob v7 and before on Windows. Please use with
|
||||
* caution, and be mindful of [the caveat below about Windows
|
||||
* paths](#windows). (For legacy reasons, this is also set if
|
||||
* `allowWindowsEscape` is set to the exact value `false`.)
|
||||
*/
|
||||
windowsPathsNoEscape?: boolean;
|
||||
/**
|
||||
* Return [PathScurry](http://npm.im/path-scurry)
|
||||
* `Path` objects instead of strings. These are similar to a
|
||||
* NodeJS `Dirent` object, but with additional methods and
|
||||
* properties.
|
||||
*
|
||||
* Conflicts with {@link absolute}
|
||||
*/
|
||||
withFileTypes?: boolean;
|
||||
/**
|
||||
* An fs implementation to override some or all of the defaults. See
|
||||
* http://npm.im/path-scurry for details about what can be overridden.
|
||||
*/
|
||||
fs?: FSOption;
|
||||
/**
|
||||
* Just passed along to Minimatch. Note that this makes all pattern
|
||||
* matching operations slower and *extremely* noisy.
|
||||
*/
|
||||
debug?: boolean;
|
||||
}
|
||||
export type GlobOptionsWithFileTypesTrue = GlobOptions & {
|
||||
withFileTypes: true;
|
||||
absolute?: undefined;
|
||||
};
|
||||
export type GlobOptionsWithFileTypesFalse = GlobOptions & {
|
||||
withFileTypes?: false;
|
||||
};
|
||||
export type GlobOptionsWithFileTypesUnset = GlobOptions & {
|
||||
withFileTypes?: undefined;
|
||||
};
|
||||
export type Result<Opts> = Opts extends GlobOptionsWithFileTypesTrue ? Path : Opts extends GlobOptionsWithFileTypesFalse ? string : Opts extends GlobOptionsWithFileTypesUnset ? string : string | Path;
|
||||
export type Results<Opts> = Result<Opts>[];
|
||||
export type FileTypes<Opts> = Opts extends GlobOptionsWithFileTypesTrue ? true : Opts extends GlobOptionsWithFileTypesFalse ? false : Opts extends GlobOptionsWithFileTypesUnset ? false : boolean;
|
||||
/**
|
||||
* An object that can perform glob pattern traversals.
|
||||
*/
|
||||
export declare class Glob<Opts extends GlobOptions> implements GlobOptions {
|
||||
absolute?: boolean;
|
||||
cwd: string;
|
||||
root?: string;
|
||||
dot: boolean;
|
||||
dotRelative: boolean;
|
||||
follow: boolean;
|
||||
ignore?: string | string[] | IgnoreLike;
|
||||
magicalBraces: boolean;
|
||||
mark?: boolean;
|
||||
matchBase: boolean;
|
||||
maxDepth: number;
|
||||
nobrace: boolean;
|
||||
nocase: boolean;
|
||||
nodir: boolean;
|
||||
noext: boolean;
|
||||
noglobstar: boolean;
|
||||
pattern: string[];
|
||||
platform: NodeJS.Platform;
|
||||
realpath: boolean;
|
||||
scurry: PathScurry;
|
||||
stat: boolean;
|
||||
signal?: AbortSignal;
|
||||
windowsPathsNoEscape: boolean;
|
||||
withFileTypes: FileTypes<Opts>;
|
||||
/**
|
||||
* The options provided to the constructor.
|
||||
*/
|
||||
opts: Opts;
|
||||
/**
|
||||
* An array of parsed immutable {@link Pattern} objects.
|
||||
*/
|
||||
patterns: Pattern[];
|
||||
/**
|
||||
* All options are stored as properties on the `Glob` object.
|
||||
*
|
||||
* See {@link GlobOptions} for full options descriptions.
|
||||
*
|
||||
* Note that a previous `Glob` object can be passed as the
|
||||
* `GlobOptions` to another `Glob` instantiation to re-use settings
|
||||
* and caches with a new pattern.
|
||||
*
|
||||
* Traversal functions can be called multiple times to run the walk
|
||||
* again.
|
||||
*/
|
||||
constructor(pattern: string | string[], opts: Opts);
|
||||
/**
|
||||
* Returns a Promise that resolves to the results array.
|
||||
*/
|
||||
walk(): Promise<Results<Opts>>;
|
||||
/**
|
||||
* synchronous {@link Glob.walk}
|
||||
*/
|
||||
walkSync(): Results<Opts>;
|
||||
/**
|
||||
* Stream results asynchronously.
|
||||
*/
|
||||
stream(): Minipass<Result<Opts>, Result<Opts>>;
|
||||
/**
|
||||
* Stream results synchronously.
|
||||
*/
|
||||
streamSync(): Minipass<Result<Opts>, Result<Opts>>;
|
||||
/**
|
||||
* Default sync iteration function. Returns a Generator that
|
||||
* iterates over the results.
|
||||
*/
|
||||
iterateSync(): Generator<Result<Opts>, void, void>;
|
||||
[Symbol.iterator](): Generator<Result<Opts>, void, void>;
|
||||
/**
|
||||
* Default async iteration function. Returns an AsyncGenerator that
|
||||
* iterates over the results.
|
||||
*/
|
||||
iterate(): AsyncGenerator<Result<Opts>, void, void>;
|
||||
[Symbol.asyncIterator](): AsyncGenerator<Result<Opts>, void, void>;
|
||||
}
|
||||
//# sourceMappingURL=glob.d.ts.map
|
1
@capacitor/cli/node_modules/glob/dist/cjs/glob.d.ts.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/cjs/glob.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAA;AACvD,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,UAAU,EAIX,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAA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AAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAa9C;;OAEG;IACH,UAAU,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAalD;;;OAGG;IACH,WAAW,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGlD,CAAC,MAAM,CAAC,QAAQ,CAAC;IAIjB;;;OAGG;IACH,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGnD,CAAC,MAAM,CAAC,aAAa,CAAC;CAGvB"}
|
229
@capacitor/cli/node_modules/glob/dist/cjs/glob.js
generated
vendored
Normal file
229
@capacitor/cli/node_modules/glob/dist/cjs/glob.js
generated
vendored
Normal file
|
@ -0,0 +1,229 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Glob = void 0;
|
||||
const minimatch_1 = require("minimatch");
|
||||
const path_scurry_1 = require("path-scurry");
|
||||
const url_1 = require("url");
|
||||
const pattern_js_1 = require("./pattern.js");
|
||||
const walker_js_1 = require("./walker.js");
|
||||
// if no process global, just call it linux.
|
||||
// so we default to case-sensitive, / separators
|
||||
const defaultPlatform = typeof process === 'object' &&
|
||||
process &&
|
||||
typeof process.platform === 'string'
|
||||
? process.platform
|
||||
: 'linux';
|
||||
/**
|
||||
* An object that can perform glob pattern traversals.
|
||||
*/
|
||||
class Glob {
|
||||
absolute;
|
||||
cwd;
|
||||
root;
|
||||
dot;
|
||||
dotRelative;
|
||||
follow;
|
||||
ignore;
|
||||
magicalBraces;
|
||||
mark;
|
||||
matchBase;
|
||||
maxDepth;
|
||||
nobrace;
|
||||
nocase;
|
||||
nodir;
|
||||
noext;
|
||||
noglobstar;
|
||||
pattern;
|
||||
platform;
|
||||
realpath;
|
||||
scurry;
|
||||
stat;
|
||||
signal;
|
||||
windowsPathsNoEscape;
|
||||
withFileTypes;
|
||||
/**
|
||||
* The options provided to the constructor.
|
||||
*/
|
||||
opts;
|
||||
/**
|
||||
* An array of parsed immutable {@link Pattern} objects.
|
||||
*/
|
||||
patterns;
|
||||
/**
|
||||
* All options are stored as properties on the `Glob` object.
|
||||
*
|
||||
* See {@link GlobOptions} for full options descriptions.
|
||||
*
|
||||
* Note that a previous `Glob` object can be passed as the
|
||||
* `GlobOptions` to another `Glob` instantiation to re-use settings
|
||||
* and caches with a new pattern.
|
||||
*
|
||||
* Traversal functions can be called multiple times to run the walk
|
||||
* again.
|
||||
*/
|
||||
constructor(pattern, opts) {
|
||||
this.withFileTypes = !!opts.withFileTypes;
|
||||
this.signal = opts.signal;
|
||||
this.follow = !!opts.follow;
|
||||
this.dot = !!opts.dot;
|
||||
this.dotRelative = !!opts.dotRelative;
|
||||
this.nodir = !!opts.nodir;
|
||||
this.mark = !!opts.mark;
|
||||
if (!opts.cwd) {
|
||||
this.cwd = '';
|
||||
}
|
||||
else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {
|
||||
opts.cwd = (0, url_1.fileURLToPath)(opts.cwd);
|
||||
}
|
||||
this.cwd = opts.cwd || '';
|
||||
this.root = opts.root;
|
||||
this.magicalBraces = !!opts.magicalBraces;
|
||||
this.nobrace = !!opts.nobrace;
|
||||
this.noext = !!opts.noext;
|
||||
this.realpath = !!opts.realpath;
|
||||
this.absolute = opts.absolute;
|
||||
this.noglobstar = !!opts.noglobstar;
|
||||
this.matchBase = !!opts.matchBase;
|
||||
this.maxDepth =
|
||||
typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity;
|
||||
this.stat = !!opts.stat;
|
||||
this.ignore = opts.ignore;
|
||||
if (this.withFileTypes && this.absolute !== undefined) {
|
||||
throw new Error('cannot set absolute and withFileTypes:true');
|
||||
}
|
||||
if (typeof pattern === 'string') {
|
||||
pattern = [pattern];
|
||||
}
|
||||
this.windowsPathsNoEscape =
|
||||
!!opts.windowsPathsNoEscape ||
|
||||
opts.allowWindowsEscape === false;
|
||||
if (this.windowsPathsNoEscape) {
|
||||
pattern = pattern.map(p => p.replace(/\\/g, '/'));
|
||||
}
|
||||
if (this.matchBase) {
|
||||
if (opts.noglobstar) {
|
||||
throw new TypeError('base matching requires globstar');
|
||||
}
|
||||
pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`));
|
||||
}
|
||||
this.pattern = pattern;
|
||||
this.platform = opts.platform || defaultPlatform;
|
||||
this.opts = { ...opts, platform: this.platform };
|
||||
if (opts.scurry) {
|
||||
this.scurry = opts.scurry;
|
||||
if (opts.nocase !== undefined &&
|
||||
opts.nocase !== opts.scurry.nocase) {
|
||||
throw new Error('nocase option contradicts provided scurry option');
|
||||
}
|
||||
}
|
||||
else {
|
||||
const Scurry = opts.platform === 'win32'
|
||||
? path_scurry_1.PathScurryWin32
|
||||
: opts.platform === 'darwin'
|
||||
? path_scurry_1.PathScurryDarwin
|
||||
: opts.platform
|
||||
? path_scurry_1.PathScurryPosix
|
||||
: path_scurry_1.PathScurry;
|
||||
this.scurry = new Scurry(this.cwd, {
|
||||
nocase: opts.nocase,
|
||||
fs: opts.fs,
|
||||
});
|
||||
}
|
||||
this.nocase = this.scurry.nocase;
|
||||
const mmo = {
|
||||
// default nocase based on platform
|
||||
...opts,
|
||||
dot: this.dot,
|
||||
matchBase: this.matchBase,
|
||||
nobrace: this.nobrace,
|
||||
nocase: this.nocase,
|
||||
nocaseMagicOnly: true,
|
||||
nocomment: true,
|
||||
noext: this.noext,
|
||||
nonegate: true,
|
||||
optimizationLevel: 2,
|
||||
platform: this.platform,
|
||||
windowsPathsNoEscape: this.windowsPathsNoEscape,
|
||||
debug: !!this.opts.debug,
|
||||
};
|
||||
const mms = this.pattern.map(p => new minimatch_1.Minimatch(p, mmo));
|
||||
const [matchSet, globParts] = mms.reduce((set, m) => {
|
||||
set[0].push(...m.set);
|
||||
set[1].push(...m.globParts);
|
||||
return set;
|
||||
}, [[], []]);
|
||||
this.patterns = matchSet.map((set, i) => {
|
||||
return new pattern_js_1.Pattern(set, globParts[i], 0, this.platform);
|
||||
});
|
||||
}
|
||||
async walk() {
|
||||
// Walkers always return array of Path objects, so we just have to
|
||||
// coerce them into the right shape. It will have already called
|
||||
// realpath() if the option was set to do so, so we know that's cached.
|
||||
// start out knowing the cwd, at least
|
||||
return [
|
||||
...(await new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity
|
||||
? this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
}).walk()),
|
||||
];
|
||||
}
|
||||
walkSync() {
|
||||
return [
|
||||
...new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity
|
||||
? this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
}).walkSync(),
|
||||
];
|
||||
}
|
||||
stream() {
|
||||
return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity
|
||||
? this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
}).stream();
|
||||
}
|
||||
streamSync() {
|
||||
return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity
|
||||
? this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
}).streamSync();
|
||||
}
|
||||
/**
|
||||
* Default sync iteration function. Returns a Generator that
|
||||
* iterates over the results.
|
||||
*/
|
||||
iterateSync() {
|
||||
return this.streamSync()[Symbol.iterator]();
|
||||
}
|
||||
[Symbol.iterator]() {
|
||||
return this.iterateSync();
|
||||
}
|
||||
/**
|
||||
* Default async iteration function. Returns an AsyncGenerator that
|
||||
* iterates over the results.
|
||||
*/
|
||||
iterate() {
|
||||
return this.stream()[Symbol.asyncIterator]();
|
||||
}
|
||||
[Symbol.asyncIterator]() {
|
||||
return this.iterate();
|
||||
}
|
||||
}
|
||||
exports.Glob = Glob;
|
||||
//# sourceMappingURL=glob.js.map
|
1
@capacitor/cli/node_modules/glob/dist/cjs/glob.js.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/cjs/glob.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
14
@capacitor/cli/node_modules/glob/dist/cjs/has-magic.d.ts
generated
vendored
Normal file
14
@capacitor/cli/node_modules/glob/dist/cjs/has-magic.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
import { GlobOptions } from './glob.js';
|
||||
/**
|
||||
* Return true if the patterns provided contain any magic glob characters,
|
||||
* given the options provided.
|
||||
*
|
||||
* Brace expansion is not considered "magic" unless the `magicalBraces` option
|
||||
* is set, as brace expansion just turns one string into an array of strings.
|
||||
* So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and
|
||||
* `'xby'` both do not contain any magic glob characters, and it's treated the
|
||||
* same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`
|
||||
* is in the options, brace expansion _is_ treated as a pattern having magic.
|
||||
*/
|
||||
export declare const hasMagic: (pattern: string | string[], options?: GlobOptions) => boolean;
|
||||
//# sourceMappingURL=has-magic.d.ts.map
|
1
@capacitor/cli/node_modules/glob/dist/cjs/has-magic.d.ts.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/cjs/has-magic.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"has-magic.d.ts","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,YACV,MAAM,GAAG,MAAM,EAAE,YACjB,WAAW,KACnB,OAQF,CAAA"}
|
27
@capacitor/cli/node_modules/glob/dist/cjs/has-magic.js
generated
vendored
Normal file
27
@capacitor/cli/node_modules/glob/dist/cjs/has-magic.js
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hasMagic = void 0;
|
||||
const minimatch_1 = require("minimatch");
|
||||
/**
|
||||
* Return true if the patterns provided contain any magic glob characters,
|
||||
* given the options provided.
|
||||
*
|
||||
* Brace expansion is not considered "magic" unless the `magicalBraces` option
|
||||
* is set, as brace expansion just turns one string into an array of strings.
|
||||
* So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and
|
||||
* `'xby'` both do not contain any magic glob characters, and it's treated the
|
||||
* same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`
|
||||
* is in the options, brace expansion _is_ treated as a pattern having magic.
|
||||
*/
|
||||
const hasMagic = (pattern, options = {}) => {
|
||||
if (!Array.isArray(pattern)) {
|
||||
pattern = [pattern];
|
||||
}
|
||||
for (const p of pattern) {
|
||||
if (new minimatch_1.Minimatch(p, options).hasMagic())
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
exports.hasMagic = hasMagic;
|
||||
//# sourceMappingURL=has-magic.js.map
|
1
@capacitor/cli/node_modules/glob/dist/cjs/has-magic.js.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/cjs/has-magic.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"has-magic.js","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AAGrC;;;;;;;;;;GAUG;AACI,MAAM,QAAQ,GAAG,CACtB,OAA0B,EAC1B,UAAuB,EAAE,EAChB,EAAE;IACX,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC3B,OAAO,GAAG,CAAC,OAAO,CAAC,CAAA;KACpB;IACD,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE;QACvB,IAAI,IAAI,qBAAS,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE;YAAE,OAAO,IAAI,CAAA;KACtD;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAXY,QAAA,QAAQ,YAWpB","sourcesContent":["import { Minimatch } from 'minimatch'\nimport { GlobOptions } from './glob.js'\n\n/**\n * Return true if the patterns provided contain any magic glob characters,\n * given the options provided.\n *\n * Brace expansion is not considered \"magic\" unless the `magicalBraces` option\n * is set, as brace expansion just turns one string into an array of strings.\n * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and\n * `'xby'` both do not contain any magic glob characters, and it's treated the\n * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`\n * is in the options, brace expansion _is_ treated as a pattern having magic.\n */\nexport const hasMagic = (\n pattern: string | string[],\n options: GlobOptions = {}\n): boolean => {\n if (!Array.isArray(pattern)) {\n pattern = [pattern]\n }\n for (const p of pattern) {\n if (new Minimatch(p, options).hasMagic()) return true\n }\n return false\n}\n"]}
|
20
@capacitor/cli/node_modules/glob/dist/cjs/ignore.d.ts
generated
vendored
Normal file
20
@capacitor/cli/node_modules/glob/dist/cjs/ignore.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { Minimatch } from 'minimatch';
|
||||
import { Path } from 'path-scurry';
|
||||
import { GlobWalkerOpts } from './walker.js';
|
||||
export interface IgnoreLike {
|
||||
ignored?: (p: Path) => boolean;
|
||||
childrenIgnored?: (p: Path) => boolean;
|
||||
}
|
||||
/**
|
||||
* Class used to process ignored patterns
|
||||
*/
|
||||
export declare class Ignore implements IgnoreLike {
|
||||
relative: Minimatch[];
|
||||
relativeChildren: Minimatch[];
|
||||
absolute: Minimatch[];
|
||||
absoluteChildren: Minimatch[];
|
||||
constructor(ignored: string[], { nobrace, nocase, noext, noglobstar, platform, }: GlobWalkerOpts);
|
||||
ignored(p: Path): boolean;
|
||||
childrenIgnored(p: Path): boolean;
|
||||
}
|
||||
//# sourceMappingURL=ignore.d.ts.map
|
1
@capacitor/cli/node_modules/glob/dist/cjs/ignore.d.ts.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/cjs/ignore.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"ignore.d.ts","sourceRoot":"","sources":["../../src/ignore.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IAC9B,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;CACvC;AASD;;GAEG;AACH,qBAAa,MAAO,YAAW,UAAU;IACvC,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;IAC7B,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;gBAG3B,OAAO,EAAE,MAAM,EAAE,EACjB,EACE,OAAO,EACP,MAAM,EACN,KAAK,EACL,UAAU,EACV,QAA0B,GAC3B,EAAE,cAAc;IAiDnB,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;IAczB,eAAe,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;CAWlC"}
|
103
@capacitor/cli/node_modules/glob/dist/cjs/ignore.js
generated
vendored
Normal file
103
@capacitor/cli/node_modules/glob/dist/cjs/ignore.js
generated
vendored
Normal file
|
@ -0,0 +1,103 @@
|
|||
"use strict";
|
||||
// give it a pattern, and it'll be able to tell you if
|
||||
// a given path should be ignored.
|
||||
// Ignoring a path ignores its children if the pattern ends in /**
|
||||
// Ignores are always parsed in dot:true mode
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Ignore = void 0;
|
||||
const minimatch_1 = require("minimatch");
|
||||
const pattern_js_1 = require("./pattern.js");
|
||||
const defaultPlatform = typeof process === 'object' &&
|
||||
process &&
|
||||
typeof process.platform === 'string'
|
||||
? process.platform
|
||||
: 'linux';
|
||||
/**
|
||||
* Class used to process ignored patterns
|
||||
*/
|
||||
class Ignore {
|
||||
relative;
|
||||
relativeChildren;
|
||||
absolute;
|
||||
absoluteChildren;
|
||||
constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = defaultPlatform, }) {
|
||||
this.relative = [];
|
||||
this.absolute = [];
|
||||
this.relativeChildren = [];
|
||||
this.absoluteChildren = [];
|
||||
const mmopts = {
|
||||
dot: true,
|
||||
nobrace,
|
||||
nocase,
|
||||
noext,
|
||||
noglobstar,
|
||||
optimizationLevel: 2,
|
||||
platform,
|
||||
nocomment: true,
|
||||
nonegate: true,
|
||||
};
|
||||
// this is a little weird, but it gives us a clean set of optimized
|
||||
// minimatch matchers, without getting tripped up if one of them
|
||||
// ends in /** inside a brace section, and it's only inefficient at
|
||||
// the start of the walk, not along it.
|
||||
// It'd be nice if the Pattern class just had a .test() method, but
|
||||
// handling globstars is a bit of a pita, and that code already lives
|
||||
// in minimatch anyway.
|
||||
// Another way would be if maybe Minimatch could take its set/globParts
|
||||
// as an option, and then we could at least just use Pattern to test
|
||||
// for absolute-ness.
|
||||
// Yet another way, Minimatch could take an array of glob strings, and
|
||||
// a cwd option, and do the right thing.
|
||||
for (const ign of ignored) {
|
||||
const mm = new minimatch_1.Minimatch(ign, mmopts);
|
||||
for (let i = 0; i < mm.set.length; i++) {
|
||||
const parsed = mm.set[i];
|
||||
const globParts = mm.globParts[i];
|
||||
const p = new pattern_js_1.Pattern(parsed, globParts, 0, platform);
|
||||
const m = new minimatch_1.Minimatch(p.globString(), mmopts);
|
||||
const children = globParts[globParts.length - 1] === '**';
|
||||
const absolute = p.isAbsolute();
|
||||
if (absolute)
|
||||
this.absolute.push(m);
|
||||
else
|
||||
this.relative.push(m);
|
||||
if (children) {
|
||||
if (absolute)
|
||||
this.absoluteChildren.push(m);
|
||||
else
|
||||
this.relativeChildren.push(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ignored(p) {
|
||||
const fullpath = p.fullpath();
|
||||
const fullpaths = `${fullpath}/`;
|
||||
const relative = p.relative() || '.';
|
||||
const relatives = `${relative}/`;
|
||||
for (const m of this.relative) {
|
||||
if (m.match(relative) || m.match(relatives))
|
||||
return true;
|
||||
}
|
||||
for (const m of this.absolute) {
|
||||
if (m.match(fullpath) || m.match(fullpaths))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
childrenIgnored(p) {
|
||||
const fullpath = p.fullpath() + '/';
|
||||
const relative = (p.relative() || '.') + '/';
|
||||
for (const m of this.relativeChildren) {
|
||||
if (m.match(relative))
|
||||
return true;
|
||||
}
|
||||
for (const m of this.absoluteChildren) {
|
||||
if (m.match(fullpath))
|
||||
true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
exports.Ignore = Ignore;
|
||||
//# sourceMappingURL=ignore.js.map
|
1
@capacitor/cli/node_modules/glob/dist/cjs/ignore.js.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/cjs/ignore.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
75
@capacitor/cli/node_modules/glob/dist/cjs/index-cjs.d.ts
generated
vendored
Normal file
75
@capacitor/cli/node_modules/glob/dist/cjs/index-cjs.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,75 @@
|
|||
declare const _default: typeof import("./index.js").glob & {
|
||||
glob: typeof import("./index.js").glob;
|
||||
globSync: typeof import("./index.js").globSync;
|
||||
sync: typeof import("./index.js").globSync & {
|
||||
stream: typeof import("./index.js").globStreamSync;
|
||||
iterate: typeof import("./index.js").globIterateSync;
|
||||
};
|
||||
globStream: typeof import("./index.js").globStream;
|
||||
stream: typeof import("./index.js").globStream & {
|
||||
sync: typeof import("./index.js").globStreamSync;
|
||||
};
|
||||
globStreamSync: typeof import("./index.js").globStreamSync;
|
||||
streamSync: typeof import("./index.js").globStreamSync;
|
||||
globIterate: typeof import("./index.js").globIterate;
|
||||
iterate: typeof import("./index.js").globIterate & {
|
||||
sync: typeof import("./index.js").globIterateSync;
|
||||
};
|
||||
globIterateSync: typeof import("./index.js").globIterateSync;
|
||||
iterateSync: typeof import("./index.js").globIterateSync;
|
||||
Glob: typeof import("./glob.js").Glob;
|
||||
hasMagic: (pattern: string | string[], options?: import("./glob.js").GlobOptions) => boolean;
|
||||
escape: (s: string, { windowsPathsNoEscape, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape"> | undefined) => string;
|
||||
unescape: (s: string, { windowsPathsNoEscape, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape"> | undefined) => string;
|
||||
} & {
|
||||
default: typeof import("./index.js").glob & {
|
||||
glob: typeof import("./index.js").glob;
|
||||
globSync: typeof import("./index.js").globSync;
|
||||
sync: typeof import("./index.js").globSync & {
|
||||
stream: typeof import("./index.js").globStreamSync;
|
||||
iterate: typeof import("./index.js").globIterateSync;
|
||||
};
|
||||
globStream: typeof import("./index.js").globStream;
|
||||
stream: typeof import("./index.js").globStream & {
|
||||
sync: typeof import("./index.js").globStreamSync;
|
||||
};
|
||||
globStreamSync: typeof import("./index.js").globStreamSync;
|
||||
streamSync: typeof import("./index.js").globStreamSync;
|
||||
globIterate: typeof import("./index.js").globIterate;
|
||||
iterate: typeof import("./index.js").globIterate & {
|
||||
sync: typeof import("./index.js").globIterateSync;
|
||||
};
|
||||
globIterateSync: typeof import("./index.js").globIterateSync;
|
||||
iterateSync: typeof import("./index.js").globIterateSync;
|
||||
Glob: typeof import("./glob.js").Glob;
|
||||
hasMagic: (pattern: string | string[], options?: import("./glob.js").GlobOptions) => boolean;
|
||||
escape: (s: string, { windowsPathsNoEscape, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape"> | undefined) => string;
|
||||
unescape: (s: string, { windowsPathsNoEscape, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape"> | undefined) => string;
|
||||
};
|
||||
glob: typeof import("./index.js").glob & {
|
||||
glob: typeof import("./index.js").glob;
|
||||
globSync: typeof import("./index.js").globSync;
|
||||
sync: typeof import("./index.js").globSync & {
|
||||
stream: typeof import("./index.js").globStreamSync;
|
||||
iterate: typeof import("./index.js").globIterateSync;
|
||||
};
|
||||
globStream: typeof import("./index.js").globStream;
|
||||
stream: typeof import("./index.js").globStream & {
|
||||
sync: typeof import("./index.js").globStreamSync;
|
||||
};
|
||||
globStreamSync: typeof import("./index.js").globStreamSync;
|
||||
streamSync: typeof import("./index.js").globStreamSync;
|
||||
globIterate: typeof import("./index.js").globIterate;
|
||||
iterate: typeof import("./index.js").globIterate & {
|
||||
sync: typeof import("./index.js").globIterateSync;
|
||||
};
|
||||
globIterateSync: typeof import("./index.js").globIterateSync;
|
||||
iterateSync: typeof import("./index.js").globIterateSync;
|
||||
Glob: typeof import("./glob.js").Glob;
|
||||
hasMagic: (pattern: string | string[], options?: import("./glob.js").GlobOptions) => boolean;
|
||||
escape: (s: string, { windowsPathsNoEscape, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape"> | undefined) => string;
|
||||
unescape: (s: string, { windowsPathsNoEscape, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape"> | undefined) => string;
|
||||
};
|
||||
};
|
||||
export = _default;
|
||||
//# sourceMappingURL=index-cjs.d.ts.map
|
1
@capacitor/cli/node_modules/glob/dist/cjs/index-cjs.d.ts.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/cjs/index-cjs.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index-cjs.d.ts","sourceRoot":"","sources":["../../src/index-cjs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kBAAqD"}
|
7
@capacitor/cli/node_modules/glob/dist/cjs/index-cjs.js
generated
vendored
Normal file
7
@capacitor/cli/node_modules/glob/dist/cjs/index-cjs.js
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
const index_js_1 = __importDefault(require("./index.js"));
|
||||
module.exports = Object.assign(index_js_1.default, { default: index_js_1.default, glob: index_js_1.default });
|
||||
//# sourceMappingURL=index-cjs.js.map
|
1
@capacitor/cli/node_modules/glob/dist/cjs/index-cjs.js.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/cjs/index-cjs.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index-cjs.js","sourceRoot":"","sources":["../../src/index-cjs.ts"],"names":[],"mappings":";;;;AAAA,0DAA6B;AAE7B,iBAAS,MAAM,CAAC,MAAM,CAAC,kBAAI,EAAE,EAAE,OAAO,EAAE,kBAAI,EAAE,IAAI,EAAJ,kBAAI,EAAE,CAAC,CAAA","sourcesContent":["import glob from './index.js'\n\nexport = Object.assign(glob, { default: glob, glob })\n"]}
|
96
@capacitor/cli/node_modules/glob/dist/cjs/index.d.ts
generated
vendored
Normal file
96
@capacitor/cli/node_modules/glob/dist/cjs/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,96 @@
|
|||
import Minipass from 'minipass';
|
||||
import { Path } from 'path-scurry';
|
||||
import type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset } from './glob.js';
|
||||
import { Glob } from './glob.js';
|
||||
/**
|
||||
* Syncronous form of {@link globStream}. Will read all the matches as fast as
|
||||
* you consume them, even all in a single tick if you consume them immediately,
|
||||
* but will still respond to backpressure if they're not consumed immediately.
|
||||
*/
|
||||
export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass<Path, Path>;
|
||||
export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass<string, string>;
|
||||
export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesUnset): Minipass<string, string>;
|
||||
export declare function globStreamSync(pattern: string | string[], options: GlobOptions): Minipass<Path, Path> | Minipass<string, string>;
|
||||
/**
|
||||
* Return a stream that emits all the strings or `Path` objects and
|
||||
* then emits `end` when completed.
|
||||
*/
|
||||
export declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass<string, string>;
|
||||
export declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass<Path, Path>;
|
||||
export declare function globStream(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Minipass<string, string>;
|
||||
export declare function globStream(pattern: string | string[], options: GlobOptions): Minipass<Path, Path> | Minipass<string, string>;
|
||||
/**
|
||||
* Synchronous form of {@link glob}
|
||||
*/
|
||||
export declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): string[];
|
||||
export declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Path[];
|
||||
export declare function globSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): string[];
|
||||
export declare function globSync(pattern: string | string[], options: GlobOptions): Path[] | string[];
|
||||
/**
|
||||
* Perform an asynchronous glob search for the pattern(s) specified. Returns
|
||||
* [Path](https://isaacs.github.io/path-scurry/classes/PathBase) objects if the
|
||||
* {@link withFileTypes} option is set to `true`. See {@link GlobOptions} for
|
||||
* full option descriptions.
|
||||
*/
|
||||
export declare function glob(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Promise<string[]>;
|
||||
export declare function glob(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Promise<Path[]>;
|
||||
export declare function glob(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Promise<string[]>;
|
||||
export declare function glob(pattern: string | string[], options: GlobOptions): Promise<Path[] | string[]>;
|
||||
/**
|
||||
* Return a sync iterator for walking glob pattern matches.
|
||||
*/
|
||||
export declare function globIterateSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Generator<string, void, void>;
|
||||
export declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Generator<Path, void, void>;
|
||||
export declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Generator<string, void, void>;
|
||||
export declare function globIterateSync(pattern: string | string[], options: GlobOptions): Generator<Path, void, void> | Generator<string, void, void>;
|
||||
/**
|
||||
* Return an async iterator for walking glob pattern matches.
|
||||
*/
|
||||
export declare function globIterate(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): AsyncGenerator<string, void, void>;
|
||||
export declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): AsyncGenerator<Path, void, void>;
|
||||
export declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): AsyncGenerator<string, void, void>;
|
||||
export declare function globIterate(pattern: string | string[], options: GlobOptions): AsyncGenerator<Path, void, void> | AsyncGenerator<string, void, void>;
|
||||
export declare const streamSync: typeof globStreamSync;
|
||||
export declare const stream: typeof globStream & {
|
||||
sync: typeof globStreamSync;
|
||||
};
|
||||
export declare const iterateSync: typeof globIterateSync;
|
||||
export declare const iterate: typeof globIterate & {
|
||||
sync: typeof globIterateSync;
|
||||
};
|
||||
export declare const sync: typeof globSync & {
|
||||
stream: typeof globStreamSync;
|
||||
iterate: typeof globIterateSync;
|
||||
};
|
||||
export { escape, unescape } from 'minimatch';
|
||||
export { Glob } from './glob.js';
|
||||
export type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset, } from './glob.js';
|
||||
export { hasMagic } from './has-magic.js';
|
||||
export type { IgnoreLike } from './ignore.js';
|
||||
export type { MatchStream } from './walker.js';
|
||||
declare const _default: typeof glob & {
|
||||
glob: typeof glob;
|
||||
globSync: typeof globSync;
|
||||
sync: typeof globSync & {
|
||||
stream: typeof globStreamSync;
|
||||
iterate: typeof globIterateSync;
|
||||
};
|
||||
globStream: typeof globStream;
|
||||
stream: typeof globStream & {
|
||||
sync: typeof globStreamSync;
|
||||
};
|
||||
globStreamSync: typeof globStreamSync;
|
||||
streamSync: typeof globStreamSync;
|
||||
globIterate: typeof globIterate;
|
||||
iterate: typeof globIterate & {
|
||||
sync: typeof globIterateSync;
|
||||
};
|
||||
globIterateSync: typeof globIterateSync;
|
||||
iterateSync: typeof globIterateSync;
|
||||
Glob: typeof Glob;
|
||||
hasMagic: (pattern: string | string[], options?: GlobOptions) => boolean;
|
||||
escape: (s: string, { windowsPathsNoEscape, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape"> | undefined) => string;
|
||||
unescape: (s: string, { windowsPathsNoEscape, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape"> | undefined) => string;
|
||||
};
|
||||
export default _default;
|
||||
//# sourceMappingURL=index.d.ts.map
|
1
@capacitor/cli/node_modules/glob/dist/cjs/index.d.ts.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/cjs/index.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,EACV,WAAW,EACX,6BAA6B,EAC7B,4BAA4B,EAC5B,6BAA6B,EAC9B,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;A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AE,IAAI,CAAC,CAAA;AASxE,eAAO,MAAM,UAAU,uBAAiB,CAAA;AACxC,eAAO,MAAM,MAAM;;CAAsD,CAAA;AACzE,eAAO,MAAM,WAAW,wBAAkB,CAAA;AAC1C,eAAO,MAAM,OAAO;;CAElB,CAAA;AACF,eAAO,MAAM,IAAI;;;CAGf,CAAA;AAGF,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,YAAY,EACV,WAAW,EACX,6BAA6B,EAC7B,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAG9C,wBAgBE"}
|
68
@capacitor/cli/node_modules/glob/dist/cjs/index.js
generated
vendored
Normal file
68
@capacitor/cli/node_modules/glob/dist/cjs/index.js
generated
vendored
Normal file
|
@ -0,0 +1,68 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hasMagic = exports.Glob = exports.unescape = exports.escape = exports.sync = exports.iterate = exports.iterateSync = exports.stream = exports.streamSync = exports.globIterate = exports.globIterateSync = exports.glob = exports.globSync = exports.globStream = exports.globStreamSync = void 0;
|
||||
const minimatch_1 = require("minimatch");
|
||||
const glob_js_1 = require("./glob.js");
|
||||
const has_magic_js_1 = require("./has-magic.js");
|
||||
function globStreamSync(pattern, options = {}) {
|
||||
return new glob_js_1.Glob(pattern, options).streamSync();
|
||||
}
|
||||
exports.globStreamSync = globStreamSync;
|
||||
function globStream(pattern, options = {}) {
|
||||
return new glob_js_1.Glob(pattern, options).stream();
|
||||
}
|
||||
exports.globStream = globStream;
|
||||
function globSync(pattern, options = {}) {
|
||||
return new glob_js_1.Glob(pattern, options).walkSync();
|
||||
}
|
||||
exports.globSync = globSync;
|
||||
async function glob(pattern, options = {}) {
|
||||
return new glob_js_1.Glob(pattern, options).walk();
|
||||
}
|
||||
exports.glob = glob;
|
||||
function globIterateSync(pattern, options = {}) {
|
||||
return new glob_js_1.Glob(pattern, options).iterateSync();
|
||||
}
|
||||
exports.globIterateSync = globIterateSync;
|
||||
function globIterate(pattern, options = {}) {
|
||||
return new glob_js_1.Glob(pattern, options).iterate();
|
||||
}
|
||||
exports.globIterate = globIterate;
|
||||
// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc
|
||||
exports.streamSync = globStreamSync;
|
||||
exports.stream = Object.assign(globStream, { sync: globStreamSync });
|
||||
exports.iterateSync = globIterateSync;
|
||||
exports.iterate = Object.assign(globIterate, {
|
||||
sync: globIterateSync,
|
||||
});
|
||||
exports.sync = Object.assign(globSync, {
|
||||
stream: globStreamSync,
|
||||
iterate: globIterateSync,
|
||||
});
|
||||
/* c8 ignore start */
|
||||
var minimatch_2 = require("minimatch");
|
||||
Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return minimatch_2.escape; } });
|
||||
Object.defineProperty(exports, "unescape", { enumerable: true, get: function () { return minimatch_2.unescape; } });
|
||||
var glob_js_2 = require("./glob.js");
|
||||
Object.defineProperty(exports, "Glob", { enumerable: true, get: function () { return glob_js_2.Glob; } });
|
||||
var has_magic_js_2 = require("./has-magic.js");
|
||||
Object.defineProperty(exports, "hasMagic", { enumerable: true, get: function () { return has_magic_js_2.hasMagic; } });
|
||||
/* c8 ignore stop */
|
||||
exports.default = Object.assign(glob, {
|
||||
glob,
|
||||
globSync,
|
||||
sync: exports.sync,
|
||||
globStream,
|
||||
stream: exports.stream,
|
||||
globStreamSync,
|
||||
streamSync: exports.streamSync,
|
||||
globIterate,
|
||||
iterate: exports.iterate,
|
||||
globIterateSync,
|
||||
iterateSync: exports.iterateSync,
|
||||
Glob: glob_js_1.Glob,
|
||||
hasMagic: has_magic_js_1.hasMagic,
|
||||
escape: minimatch_1.escape,
|
||||
unescape: minimatch_1.unescape,
|
||||
});
|
||||
//# sourceMappingURL=index.js.map
|
1
@capacitor/cli/node_modules/glob/dist/cjs/index.js.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/cjs/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
@capacitor/cli/node_modules/glob/dist/cjs/package.json
generated
vendored
Normal file
3
@capacitor/cli/node_modules/glob/dist/cjs/package.json
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"type": "commonjs"
|
||||
}
|
77
@capacitor/cli/node_modules/glob/dist/cjs/pattern.d.ts
generated
vendored
Normal file
77
@capacitor/cli/node_modules/glob/dist/cjs/pattern.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,77 @@
|
|||
/// <reference types="node" />
|
||||
import { GLOBSTAR } from 'minimatch';
|
||||
export type MMPattern = string | RegExp | typeof GLOBSTAR;
|
||||
export type PatternList = [p: MMPattern, ...rest: MMPattern[]];
|
||||
export type UNCPatternList = [
|
||||
p0: '',
|
||||
p1: '',
|
||||
p2: string,
|
||||
p3: string,
|
||||
...rest: MMPattern[]
|
||||
];
|
||||
export type DrivePatternList = [p0: string, ...rest: MMPattern[]];
|
||||
export type AbsolutePatternList = [p0: '', ...rest: MMPattern[]];
|
||||
export type GlobList = [p: string, ...rest: string[]];
|
||||
/**
|
||||
* An immutable-ish view on an array of glob parts and their parsed
|
||||
* results
|
||||
*/
|
||||
export declare class Pattern {
|
||||
#private;
|
||||
readonly length: number;
|
||||
constructor(patternList: MMPattern[], globList: string[], index: number, platform: NodeJS.Platform);
|
||||
/**
|
||||
* The first entry in the parsed list of patterns
|
||||
*/
|
||||
pattern(): MMPattern;
|
||||
/**
|
||||
* true of if pattern() returns a string
|
||||
*/
|
||||
isString(): boolean;
|
||||
/**
|
||||
* true of if pattern() returns GLOBSTAR
|
||||
*/
|
||||
isGlobstar(): boolean;
|
||||
/**
|
||||
* true if pattern() returns a regexp
|
||||
*/
|
||||
isRegExp(): boolean;
|
||||
/**
|
||||
* The /-joined set of glob parts that make up this pattern
|
||||
*/
|
||||
globString(): string;
|
||||
/**
|
||||
* true if there are more pattern parts after this one
|
||||
*/
|
||||
hasMore(): boolean;
|
||||
/**
|
||||
* The rest of the pattern after this part, or null if this is the end
|
||||
*/
|
||||
rest(): Pattern | null;
|
||||
/**
|
||||
* true if the pattern represents a //unc/path/ on windows
|
||||
*/
|
||||
isUNC(): boolean;
|
||||
/**
|
||||
* True if the pattern starts with a drive letter on Windows
|
||||
*/
|
||||
isDrive(): boolean;
|
||||
/**
|
||||
* True if the pattern is rooted on an absolute path
|
||||
*/
|
||||
isAbsolute(): boolean;
|
||||
/**
|
||||
* consume the root of the pattern, and return it
|
||||
*/
|
||||
root(): string;
|
||||
/**
|
||||
* Check to see if the current globstar pattern is allowed to follow
|
||||
* a symbolic link.
|
||||
*/
|
||||
checkFollowGlobstar(): boolean;
|
||||
/**
|
||||
* Mark that the current globstar pattern is following a symbolic link
|
||||
*/
|
||||
markFollowGlobstar(): boolean;
|
||||
}
|
||||
//# sourceMappingURL=pattern.d.ts.map
|
1
@capacitor/cli/node_modules/glob/dist/cjs/pattern.d.ts.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/cjs/pattern.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"pattern.d.ts","sourceRoot":"","sources":["../../src/pattern.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,QAAQ,CAAA;AAGzD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;AAC9D,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,EAAE;IAC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ern.js
generated
vendored
Normal file
|
@ -0,0 +1,219 @@
|
|||
"use strict";
|
||||
// this is just a very light wrapper around 2 arrays with an offset index
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Pattern = void 0;
|
||||
const minimatch_1 = require("minimatch");
|
||||
const isPatternList = (pl) => pl.length >= 1;
|
||||
const isGlobList = (gl) => gl.length >= 1;
|
||||
/**
|
||||
* An immutable-ish view on an array of glob parts and their parsed
|
||||
* results
|
||||
*/
|
||||
class Pattern {
|
||||
#patternList;
|
||||
#globList;
|
||||
#index;
|
||||
length;
|
||||
#platform;
|
||||
#rest;
|
||||
#globString;
|
||||
#isDrive;
|
||||
#isUNC;
|
||||
#isAbsolute;
|
||||
#followGlobstar = true;
|
||||
constructor(patternList, globList, index, platform) {
|
||||
if (!isPatternList(patternList)) {
|
||||
throw new TypeError('empty pattern list');
|
||||
}
|
||||
if (!isGlobList(globList)) {
|
||||
throw new TypeError('empty glob list');
|
||||
}
|
||||
if (globList.length !== patternList.length) {
|
||||
throw new TypeError('mismatched pattern list and glob list lengths');
|
||||
}
|
||||
this.length = patternList.length;
|
||||
if (index < 0 || index >= this.length) {
|
||||
throw new TypeError('index out of range');
|
||||
}
|
||||
this.#patternList = patternList;
|
||||
this.#globList = globList;
|
||||
this.#index = index;
|
||||
this.#platform = platform;
|
||||
// normalize root entries of absolute patterns on initial creation.
|
||||
if (this.#index === 0) {
|
||||
// c: => ['c:/']
|
||||
// C:/ => ['C:/']
|
||||
// C:/x => ['C:/', 'x']
|
||||
// //host/share => ['//host/share/']
|
||||
// //host/share/ => ['//host/share/']
|
||||
// //host/share/x => ['//host/share/', 'x']
|
||||
// /etc => ['/', 'etc']
|
||||
// / => ['/']
|
||||
if (this.isUNC()) {
|
||||
// '' / '' / 'host' / 'share'
|
||||
const [p0, p1, p2, p3, ...prest] = this.#patternList;
|
||||
const [g0, g1, g2, g3, ...grest] = this.#globList;
|
||||
if (prest[0] === '') {
|
||||
// ends in /
|
||||
prest.shift();
|
||||
grest.shift();
|
||||
}
|
||||
const p = [p0, p1, p2, p3, ''].join('/');
|
||||
const g = [g0, g1, g2, g3, ''].join('/');
|
||||
this.#patternList = [p, ...prest];
|
||||
this.#globList = [g, ...grest];
|
||||
this.length = this.#patternList.length;
|
||||
}
|
||||
else if (this.isDrive() || this.isAbsolute()) {
|
||||
const [p1, ...prest] = this.#patternList;
|
||||
const [g1, ...grest] = this.#globList;
|
||||
if (prest[0] === '') {
|
||||
// ends in /
|
||||
prest.shift();
|
||||
grest.shift();
|
||||
}
|
||||
const p = p1 + '/';
|
||||
const g = g1 + '/';
|
||||
this.#patternList = [p, ...prest];
|
||||
this.#globList = [g, ...grest];
|
||||
this.length = this.#patternList.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The first entry in the parsed list of patterns
|
||||
*/
|
||||
pattern() {
|
||||
return this.#patternList[this.#index];
|
||||
}
|
||||
/**
|
||||
* true of if pattern() returns a string
|
||||
*/
|
||||
isString() {
|
||||
return typeof this.#patternList[this.#index] === 'string';
|
||||
}
|
||||
/**
|
||||
* true of if pattern() returns GLOBSTAR
|
||||
*/
|
||||
isGlobstar() {
|
||||
return this.#patternList[this.#index] === minimatch_1.GLOBSTAR;
|
||||
}
|
||||
/**
|
||||
* true if pattern() returns a regexp
|
||||
*/
|
||||
isRegExp() {
|
||||
return this.#patternList[this.#index] instanceof RegExp;
|
||||
}
|
||||
/**
|
||||
* The /-joined set of glob parts that make up this pattern
|
||||
*/
|
||||
globString() {
|
||||
return (this.#globString =
|
||||
this.#globString ||
|
||||
(this.#index === 0
|
||||
? this.isAbsolute()
|
||||
? this.#globList[0] + this.#globList.slice(1).join('/')
|
||||
: this.#globList.join('/')
|
||||
: this.#globList.slice(this.#index).join('/')));
|
||||
}
|
||||
/**
|
||||
* true if there are more pattern parts after this one
|
||||
*/
|
||||
hasMore() {
|
||||
return this.length > this.#index + 1;
|
||||
}
|
||||
/**
|
||||
* The rest of the pattern after this part, or null if this is the end
|
||||
*/
|
||||
rest() {
|
||||
if (this.#rest !== undefined)
|
||||
return this.#rest;
|
||||
if (!this.hasMore())
|
||||
return (this.#rest = null);
|
||||
this.#rest = new Pattern(this.#patternList, this.#globList, this.#index + 1, this.#platform);
|
||||
this.#rest.#isAbsolute = this.#isAbsolute;
|
||||
this.#rest.#isUNC = this.#isUNC;
|
||||
this.#rest.#isDrive = this.#isDrive;
|
||||
return this.#rest;
|
||||
}
|
||||
/**
|
||||
* true if the pattern represents a //unc/path/ on windows
|
||||
*/
|
||||
isUNC() {
|
||||
const pl = this.#patternList;
|
||||
return this.#isUNC !== undefined
|
||||
? this.#isUNC
|
||||
: (this.#isUNC =
|
||||
this.#platform === 'win32' &&
|
||||
this.#index === 0 &&
|
||||
pl[0] === '' &&
|
||||
pl[1] === '' &&
|
||||
typeof pl[2] === 'string' &&
|
||||
!!pl[2] &&
|
||||
typeof pl[3] === 'string' &&
|
||||
!!pl[3]);
|
||||
}
|
||||
// pattern like C:/...
|
||||
// split = ['C:', ...]
|
||||
// XXX: would be nice to handle patterns like `c:*` to test the cwd
|
||||
// in c: for *, but I don't know of a way to even figure out what that
|
||||
// cwd is without actually chdir'ing into it?
|
||||
/**
|
||||
* True if the pattern starts with a drive letter on Windows
|
||||
*/
|
||||
isDrive() {
|
||||
const pl = this.#patternList;
|
||||
return this.#isDrive !== undefined
|
||||
? this.#isDrive
|
||||
: (this.#isDrive =
|
||||
this.#platform === 'win32' &&
|
||||
this.#index === 0 &&
|
||||
this.length > 1 &&
|
||||
typeof pl[0] === 'string' &&
|
||||
/^[a-z]:$/i.test(pl[0]));
|
||||
}
|
||||
// pattern = '/' or '/...' or '/x/...'
|
||||
// split = ['', ''] or ['', ...] or ['', 'x', ...]
|
||||
// Drive and UNC both considered absolute on windows
|
||||
/**
|
||||
* True if the pattern is rooted on an absolute path
|
||||
*/
|
||||
isAbsolute() {
|
||||
const pl = this.#patternList;
|
||||
return this.#isAbsolute !== undefined
|
||||
? this.#isAbsolute
|
||||
: (this.#isAbsolute =
|
||||
(pl[0] === '' && pl.length > 1) ||
|
||||
this.isDrive() ||
|
||||
this.isUNC());
|
||||
}
|
||||
/**
|
||||
* consume the root of the pattern, and return it
|
||||
*/
|
||||
root() {
|
||||
const p = this.#patternList[0];
|
||||
return typeof p === 'string' && this.isAbsolute() && this.#index === 0
|
||||
? p
|
||||
: '';
|
||||
}
|
||||
/**
|
||||
* Check to see if the current globstar pattern is allowed to follow
|
||||
* a symbolic link.
|
||||
*/
|
||||
checkFollowGlobstar() {
|
||||
return !(this.#index === 0 ||
|
||||
!this.isGlobstar() ||
|
||||
!this.#followGlobstar);
|
||||
}
|
||||
/**
|
||||
* Mark that the current globstar pattern is following a symbolic link
|
||||
*/
|
||||
markFollowGlobstar() {
|
||||
if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)
|
||||
return false;
|
||||
this.#followGlobstar = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
exports.Pattern = Pattern;
|
||||
//# sourceMappingURL=pattern.js.map
|
1
@capacitor/cli/node_modules/glob/dist/cjs/pattern.js.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/cjs/pattern.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
59
@capacitor/cli/node_modules/glob/dist/cjs/processor.d.ts
generated
vendored
Normal file
59
@capacitor/cli/node_modules/glob/dist/cjs/processor.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,59 @@
|
|||
import { MMRegExp } from 'minimatch';
|
||||
import { Path } from 'path-scurry';
|
||||
import { Pattern } from './pattern.js';
|
||||
import { GlobWalkerOpts } from './walker.js';
|
||||
/**
|
||||
* A cache of which patterns have been processed for a given Path
|
||||
*/
|
||||
export declare class HasWalkedCache {
|
||||
store: Map<string, Set<string>>;
|
||||
constructor(store?: Map<string, Set<string>>);
|
||||
copy(): HasWalkedCache;
|
||||
hasWalked(target: Path, pattern: Pattern): boolean | undefined;
|
||||
storeWalked(target: Path, pattern: Pattern): void;
|
||||
}
|
||||
/**
|
||||
* A record of which paths have been matched in a given walk step,
|
||||
* and whether they only are considered a match if they are a directory,
|
||||
* and whether their absolute or relative path should be returned.
|
||||
*/
|
||||
export declare class MatchRecord {
|
||||
store: Map<Path, number>;
|
||||
add(target: Path, absolute: boolean, ifDir: boolean): void;
|
||||
entries(): [Path, boolean, boolean][];
|
||||
}
|
||||
/**
|
||||
* A collection of patterns that must be processed in a subsequent step
|
||||
* for a given path.
|
||||
*/
|
||||
export declare class SubWalks {
|
||||
store: Map<Path, Pattern[]>;
|
||||
add(target: Path, pattern: Pattern): void;
|
||||
get(target: Path): Pattern[];
|
||||
entries(): [Path, Pattern[]][];
|
||||
keys(): Path[];
|
||||
}
|
||||
/**
|
||||
* The class that processes patterns for a given path.
|
||||
*
|
||||
* Handles child entry filtering, and determining whether a path's
|
||||
* directory contents must be read.
|
||||
*/
|
||||
export declare class Processor {
|
||||
hasWalkedCache: HasWalkedCache;
|
||||
matches: MatchRecord;
|
||||
subwalks: SubWalks;
|
||||
patterns?: Pattern[];
|
||||
follow: boolean;
|
||||
dot: boolean;
|
||||
opts: GlobWalkerOpts;
|
||||
constructor(opts: GlobWalkerOpts, hasWalkedCache?: HasWalkedCache);
|
||||
processPatterns(target: Path, patterns: Pattern[]): this;
|
||||
subwalkTargets(): Path[];
|
||||
child(): Processor;
|
||||
filterEntries(parent: Path, entries: Path[]): Processor;
|
||||
testGlobstar(e: Path, pattern: Pattern, rest: Pattern | null, absolute: boolean): void;
|
||||
testRegExp(e: Path, p: MMRegExp, rest: Pattern | null, absolute: boolean): void;
|
||||
testString(e: Path, p: string, rest: Pattern | null, absolute: boolean): void;
|
||||
}
|
||||
//# sourceMappingURL=processor.d.ts.map
|
1
@capacitor/cli/node_modules/glob/dist/cjs/processor.d.ts.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/cjs/processor.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"processor.d.ts","sourceRoot":"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QAAQ,CAAC,EAAE,OAAO,EAAE,CAAA;IACpB,MAAM,EAAE,OAAO,CAAA;IACf,GAAG,EAAE,OAAO,CAAA;IACZ,IAAI,EAAE,cAAc,CAAA;gBAER,IAAI,EAAE,cAAc,EAAE,cAAc,CAAC,EAAE,cAAc;IASjE,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE;IAwGjD,cAAc,IAAI,IAAI,EAAE;IAIxB,KAAK;IAQL,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,SAAS;IAqBvD,YAAY,CACV,CAAC,EAAE,IAAI,EACP,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,OAAO,GAAG,IAAI,EACpB,QAAQ,EAAE,OAAO;IA8CnB,UAAU,CACR,CAAC,EAAE,IAAI,EACP,CAAC,EAAE,QAAQ,EACX,IAAI,EAAE,OAAO,GAAG,IAAI,EACpB,QAAQ,EAAE,OAAO;IAUnB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,EAAE,QAAQ,EAAE,OAAO;CASvE"}
|
309
@capacitor/cli/node_modules/glob/dist/cjs/processor.js
generated
vendored
Normal file
309
@capacitor/cli/node_modules/glob/dist/cjs/processor.js
generated
vendored
Normal file
|
@ -0,0 +1,309 @@
|
|||
"use strict";
|
||||
// synchronous utility for filtering entries and calculating subwalks
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Processor = exports.SubWalks = exports.MatchRecord = exports.HasWalkedCache = void 0;
|
||||
const minimatch_1 = require("minimatch");
|
||||
/**
|
||||
* A cache of which patterns have been processed for a given Path
|
||||
*/
|
||||
class HasWalkedCache {
|
||||
store;
|
||||
constructor(store = new Map()) {
|
||||
this.store = store;
|
||||
}
|
||||
copy() {
|
||||
return new HasWalkedCache(new Map(this.store));
|
||||
}
|
||||
hasWalked(target, pattern) {
|
||||
return this.store.get(target.fullpath())?.has(pattern.globString());
|
||||
}
|
||||
storeWalked(target, pattern) {
|
||||
const fullpath = target.fullpath();
|
||||
const cached = this.store.get(fullpath);
|
||||
if (cached)
|
||||
cached.add(pattern.globString());
|
||||
else
|
||||
this.store.set(fullpath, new Set([pattern.globString()]));
|
||||
}
|
||||
}
|
||||
exports.HasWalkedCache = HasWalkedCache;
|
||||
/**
|
||||
* A record of which paths have been matched in a given walk step,
|
||||
* and whether they only are considered a match if they are a directory,
|
||||
* and whether their absolute or relative path should be returned.
|
||||
*/
|
||||
class MatchRecord {
|
||||
store = new Map();
|
||||
add(target, absolute, ifDir) {
|
||||
const n = (absolute ? 2 : 0) | (ifDir ? 1 : 0);
|
||||
const current = this.store.get(target);
|
||||
this.store.set(target, current === undefined ? n : n & current);
|
||||
}
|
||||
// match, absolute, ifdir
|
||||
entries() {
|
||||
return [...this.store.entries()].map(([path, n]) => [
|
||||
path,
|
||||
!!(n & 2),
|
||||
!!(n & 1),
|
||||
]);
|
||||
}
|
||||
}
|
||||
exports.MatchRecord = MatchRecord;
|
||||
/**
|
||||
* A collection of patterns that must be processed in a subsequent step
|
||||
* for a given path.
|
||||
*/
|
||||
class SubWalks {
|
||||
store = new Map();
|
||||
add(target, pattern) {
|
||||
if (!target.canReaddir()) {
|
||||
return;
|
||||
}
|
||||
const subs = this.store.get(target);
|
||||
if (subs) {
|
||||
if (!subs.find(p => p.globString() === pattern.globString())) {
|
||||
subs.push(pattern);
|
||||
}
|
||||
}
|
||||
else
|
||||
this.store.set(target, [pattern]);
|
||||
}
|
||||
get(target) {
|
||||
const subs = this.store.get(target);
|
||||
/* c8 ignore start */
|
||||
if (!subs) {
|
||||
throw new Error('attempting to walk unknown path');
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
return subs;
|
||||
}
|
||||
entries() {
|
||||
return this.keys().map(k => [k, this.store.get(k)]);
|
||||
}
|
||||
keys() {
|
||||
return [...this.store.keys()].filter(t => t.canReaddir());
|
||||
}
|
||||
}
|
||||
exports.SubWalks = SubWalks;
|
||||
/**
|
||||
* The class that processes patterns for a given path.
|
||||
*
|
||||
* Handles child entry filtering, and determining whether a path's
|
||||
* directory contents must be read.
|
||||
*/
|
||||
class Processor {
|
||||
hasWalkedCache;
|
||||
matches = new MatchRecord();
|
||||
subwalks = new SubWalks();
|
||||
patterns;
|
||||
follow;
|
||||
dot;
|
||||
opts;
|
||||
constructor(opts, hasWalkedCache) {
|
||||
this.opts = opts;
|
||||
this.follow = !!opts.follow;
|
||||
this.dot = !!opts.dot;
|
||||
this.hasWalkedCache = hasWalkedCache
|
||||
? hasWalkedCache.copy()
|
||||
: new HasWalkedCache();
|
||||
}
|
||||
processPatterns(target, patterns) {
|
||||
this.patterns = patterns;
|
||||
const processingSet = patterns.map(p => [target, p]);
|
||||
// map of paths to the magic-starting subwalks they need to walk
|
||||
// first item in patterns is the filter
|
||||
for (let [t, pattern] of processingSet) {
|
||||
this.hasWalkedCache.storeWalked(t, pattern);
|
||||
const root = pattern.root();
|
||||
const absolute = pattern.isAbsolute() && this.opts.absolute !== false;
|
||||
// start absolute patterns at root
|
||||
if (root) {
|
||||
t = t.resolve(root === '/' && this.opts.root !== undefined
|
||||
? this.opts.root
|
||||
: root);
|
||||
const rest = pattern.rest();
|
||||
if (!rest) {
|
||||
this.matches.add(t, true, false);
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
pattern = rest;
|
||||
}
|
||||
}
|
||||
if (t.isENOENT())
|
||||
continue;
|
||||
let p;
|
||||
let rest;
|
||||
let changed = false;
|
||||
while (typeof (p = pattern.pattern()) === 'string' &&
|
||||
(rest = pattern.rest())) {
|
||||
const c = t.resolve(p);
|
||||
// we can be reasonably sure that .. is a readable dir
|
||||
if (c.isUnknown() && p !== '..')
|
||||
break;
|
||||
t = c;
|
||||
pattern = rest;
|
||||
changed = true;
|
||||
}
|
||||
p = pattern.pattern();
|
||||
rest = pattern.rest();
|
||||
if (changed) {
|
||||
if (this.hasWalkedCache.hasWalked(t, pattern))
|
||||
continue;
|
||||
this.hasWalkedCache.storeWalked(t, pattern);
|
||||
}
|
||||
// now we have either a final string for a known entry,
|
||||
// more strings for an unknown entry,
|
||||
// or a pattern starting with magic, mounted on t.
|
||||
if (typeof p === 'string') {
|
||||
// must be final entry
|
||||
if (!rest) {
|
||||
const ifDir = p === '..' || p === '' || p === '.';
|
||||
this.matches.add(t.resolve(p), absolute, ifDir);
|
||||
}
|
||||
else {
|
||||
this.subwalks.add(t, pattern);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else if (p === minimatch_1.GLOBSTAR) {
|
||||
// if no rest, match and subwalk pattern
|
||||
// if rest, process rest and subwalk pattern
|
||||
// if it's a symlink, but we didn't get here by way of a
|
||||
// globstar match (meaning it's the first time THIS globstar
|
||||
// has traversed a symlink), then we follow it. Otherwise, stop.
|
||||
if (!t.isSymbolicLink() ||
|
||||
this.follow ||
|
||||
pattern.checkFollowGlobstar()) {
|
||||
this.subwalks.add(t, pattern);
|
||||
}
|
||||
const rp = rest?.pattern();
|
||||
const rrest = rest?.rest();
|
||||
if (!rest || ((rp === '' || rp === '.') && !rrest)) {
|
||||
// only HAS to be a dir if it ends in **/ or **/.
|
||||
// but ending in ** will match files as well.
|
||||
this.matches.add(t, absolute, rp === '' || rp === '.');
|
||||
}
|
||||
else {
|
||||
if (rp === '..') {
|
||||
// this would mean you're matching **/.. at the fs root,
|
||||
// and no thanks, I'm not gonna test that specific case.
|
||||
/* c8 ignore start */
|
||||
const tp = t.parent || t;
|
||||
/* c8 ignore stop */
|
||||
if (!rrest)
|
||||
this.matches.add(tp, absolute, true);
|
||||
else if (!this.hasWalkedCache.hasWalked(tp, rrest)) {
|
||||
this.subwalks.add(tp, rrest);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (p instanceof RegExp) {
|
||||
this.subwalks.add(t, pattern);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
subwalkTargets() {
|
||||
return this.subwalks.keys();
|
||||
}
|
||||
child() {
|
||||
return new Processor(this.opts, this.hasWalkedCache);
|
||||
}
|
||||
// return a new Processor containing the subwalks for each
|
||||
// child entry, and a set of matches, and
|
||||
// a hasWalkedCache that's a copy of this one
|
||||
// then we're going to call
|
||||
filterEntries(parent, entries) {
|
||||
const patterns = this.subwalks.get(parent);
|
||||
// put matches and entry walks into the results processor
|
||||
const results = this.child();
|
||||
for (const e of entries) {
|
||||
for (const pattern of patterns) {
|
||||
const absolute = pattern.isAbsolute();
|
||||
const p = pattern.pattern();
|
||||
const rest = pattern.rest();
|
||||
if (p === minimatch_1.GLOBSTAR) {
|
||||
results.testGlobstar(e, pattern, rest, absolute);
|
||||
}
|
||||
else if (p instanceof RegExp) {
|
||||
results.testRegExp(e, p, rest, absolute);
|
||||
}
|
||||
else {
|
||||
results.testString(e, p, rest, absolute);
|
||||
}
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
testGlobstar(e, pattern, rest, absolute) {
|
||||
if (this.dot || !e.name.startsWith('.')) {
|
||||
if (!pattern.hasMore()) {
|
||||
this.matches.add(e, absolute, false);
|
||||
}
|
||||
if (e.canReaddir()) {
|
||||
// if we're in follow mode or it's not a symlink, just keep
|
||||
// testing the same pattern. If there's more after the globstar,
|
||||
// then this symlink consumes the globstar. If not, then we can
|
||||
// follow at most ONE symlink along the way, so we mark it, which
|
||||
// also checks to ensure that it wasn't already marked.
|
||||
if (this.follow || !e.isSymbolicLink()) {
|
||||
this.subwalks.add(e, pattern);
|
||||
}
|
||||
else if (e.isSymbolicLink()) {
|
||||
if (rest && pattern.checkFollowGlobstar()) {
|
||||
this.subwalks.add(e, rest);
|
||||
}
|
||||
else if (pattern.markFollowGlobstar()) {
|
||||
this.subwalks.add(e, pattern);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// if the NEXT thing matches this entry, then also add
|
||||
// the rest.
|
||||
if (rest) {
|
||||
const rp = rest.pattern();
|
||||
if (typeof rp === 'string' &&
|
||||
// dots and empty were handled already
|
||||
rp !== '..' &&
|
||||
rp !== '' &&
|
||||
rp !== '.') {
|
||||
this.testString(e, rp, rest.rest(), absolute);
|
||||
}
|
||||
else if (rp === '..') {
|
||||
/* c8 ignore start */
|
||||
const ep = e.parent || e;
|
||||
/* c8 ignore stop */
|
||||
this.subwalks.add(ep, rest);
|
||||
}
|
||||
else if (rp instanceof RegExp) {
|
||||
this.testRegExp(e, rp, rest.rest(), absolute);
|
||||
}
|
||||
}
|
||||
}
|
||||
testRegExp(e, p, rest, absolute) {
|
||||
if (!p.test(e.name))
|
||||
return;
|
||||
if (!rest) {
|
||||
this.matches.add(e, absolute, false);
|
||||
}
|
||||
else {
|
||||
this.subwalks.add(e, rest);
|
||||
}
|
||||
}
|
||||
testString(e, p, rest, absolute) {
|
||||
// should never happen?
|
||||
if (!e.isNamed(p))
|
||||
return;
|
||||
if (!rest) {
|
||||
this.matches.add(e, absolute, false);
|
||||
}
|
||||
else {
|
||||
this.subwalks.add(e, rest);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.Processor = Processor;
|
||||
//# sourceMappingURL=processor.js.map
|
1
@capacitor/cli/node_modules/glob/dist/cjs/processor.js.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/cjs/processor.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
95
@capacitor/cli/node_modules/glob/dist/cjs/walker.d.ts
generated
vendored
Normal file
95
@capacitor/cli/node_modules/glob/dist/cjs/walker.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,95 @@
|
|||
/// <reference types="node" />
|
||||
/**
|
||||
* Single-use utility classes to provide functionality to the {@link Glob}
|
||||
* methods.
|
||||
*
|
||||
* @module
|
||||
*/
|
||||
import Minipass from 'minipass';
|
||||
import { Path } from 'path-scurry';
|
||||
import { IgnoreLike } from './ignore.js';
|
||||
import { Pattern } from './pattern.js';
|
||||
import { Processor } from './processor.js';
|
||||
export interface GlobWalkerOpts {
|
||||
absolute?: boolean;
|
||||
allowWindowsEscape?: boolean;
|
||||
cwd?: string | URL;
|
||||
dot?: boolean;
|
||||
dotRelative?: boolean;
|
||||
follow?: boolean;
|
||||
ignore?: string | string[] | IgnoreLike;
|
||||
mark?: boolean;
|
||||
matchBase?: boolean;
|
||||
maxDepth?: number;
|
||||
nobrace?: boolean;
|
||||
nocase?: boolean;
|
||||
nodir?: boolean;
|
||||
noext?: boolean;
|
||||
noglobstar?: boolean;
|
||||
platform?: NodeJS.Platform;
|
||||
realpath?: boolean;
|
||||
root?: string;
|
||||
stat?: boolean;
|
||||
signal?: AbortSignal;
|
||||
windowsPathsNoEscape?: boolean;
|
||||
withFileTypes?: boolean;
|
||||
}
|
||||
export type GWOFileTypesTrue = GlobWalkerOpts & {
|
||||
withFileTypes: true;
|
||||
};
|
||||
export type GWOFileTypesFalse = GlobWalkerOpts & {
|
||||
withFileTypes: false;
|
||||
};
|
||||
export type GWOFileTypesUnset = GlobWalkerOpts & {
|
||||
withFileTypes?: undefined;
|
||||
};
|
||||
export type Result<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Path : O extends GWOFileTypesFalse ? string : O extends GWOFileTypesUnset ? string : Path | string;
|
||||
export type Matches<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Set<Path> : O extends GWOFileTypesFalse ? Set<string> : O extends GWOFileTypesUnset ? Set<string> : Set<Path | string>;
|
||||
export type MatchStream<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Minipass<Path, Path> : O extends GWOFileTypesFalse ? Minipass<string, string> : O extends GWOFileTypesUnset ? Minipass<string, string> : Minipass<Path | string, Path | string>;
|
||||
/**
|
||||
* basic walking utilities that all the glob walker types use
|
||||
*/
|
||||
export declare abstract class GlobUtil<O extends GlobWalkerOpts = GlobWalkerOpts> {
|
||||
#private;
|
||||
path: Path;
|
||||
patterns: Pattern[];
|
||||
opts: O;
|
||||
seen: Set<Path>;
|
||||
paused: boolean;
|
||||
aborted: boolean;
|
||||
signal?: AbortSignal;
|
||||
maxDepth: number;
|
||||
constructor(patterns: Pattern[], path: Path, opts: O);
|
||||
pause(): void;
|
||||
resume(): void;
|
||||
onResume(fn: () => any): void;
|
||||
matchCheck(e: Path, ifDir: boolean): Promise<Path | undefined>;
|
||||
matchCheckTest(e: Path | undefined, ifDir: boolean): Path | undefined;
|
||||
matchCheckSync(e: Path, ifDir: boolean): Path | undefined;
|
||||
abstract matchEmit(p: Result<O>): void;
|
||||
abstract matchEmit(p: string | Path): void;
|
||||
matchFinish(e: Path, absolute: boolean): void;
|
||||
match(e: Path, absolute: boolean, ifDir: boolean): Promise<void>;
|
||||
matchSync(e: Path, absolute: boolean, ifDir: boolean): void;
|
||||
walkCB(target: Path, patterns: Pattern[], cb: () => any): void;
|
||||
walkCB2(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any;
|
||||
walkCB3(target: Path, entries: Path[], processor: Processor, cb: () => any): void;
|
||||
walkCBSync(target: Path, patterns: Pattern[], cb: () => any): void;
|
||||
walkCB2Sync(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any;
|
||||
walkCB3Sync(target: Path, entries: Path[], processor: Processor, cb: () => any): void;
|
||||
}
|
||||
export declare class GlobWalker<O extends GlobWalkerOpts = GlobWalkerOpts> extends GlobUtil<O> {
|
||||
matches: O extends GWOFileTypesTrue ? Set<Path> : O extends GWOFileTypesFalse ? Set<string> : O extends GWOFileTypesUnset ? Set<string> : Set<Path | string>;
|
||||
constructor(patterns: Pattern[], path: Path, opts: O);
|
||||
matchEmit(e: Result<O>): void;
|
||||
walk(): Promise<Matches<O>>;
|
||||
walkSync(): Matches<O>;
|
||||
}
|
||||
export declare class GlobStream<O extends GlobWalkerOpts = GlobWalkerOpts> extends GlobUtil<O> {
|
||||
results: O extends GWOFileTypesTrue ? Minipass<Path, Path> : O extends GWOFileTypesFalse ? Minipass<string, string> : O extends GWOFileTypesUnset ? Minipass<string, string> : Minipass<Path | string, Path | string>;
|
||||
constructor(patterns: Pattern[], path: Path, opts: O);
|
||||
matchEmit(e: Result<O>): void;
|
||||
stream(): MatchStream<O>;
|
||||
streamSync(): MatchStream<O>;
|
||||
}
|
||||
//# sourceMappingURL=walker.d.ts.map
|
1
@capacitor/cli/node_modules/glob/dist/cjs/walker.d.ts.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/cjs/walker.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"walker.d.ts","sourceRoot":"","sources":["../../src/walker.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;AACH,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAU,UAAU,EAAE,MAAM,aAAa,CAAA;AAOhD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;IAClB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,CAAA;IACvC,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,SAAS,CAAC,EAAE,OAAO,CAAA;IAGnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAA;IAC1B,QAAQ,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C,CAAC,CAAC;IAiBjC,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC;CAWvB;AAED,qBAAa,UAAU,CACrB,CAAC,SAAS,cAAc,GAAG,cAAc,CACzC,SAAQ,QAAQ,CAAC,CAAC,CAAC;IACnB,OAAO,EAAE,CAAC,SAAS,gBAAgB,GAC/B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,GACpB,CAAC,SAAS,iBAAiB,GAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,GACxB,CAAC,SAAS,iBAAiB,GAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,GACxB,QAAQ,CAAC,IAAI,GAAG,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC,CAAA;gBAE9B,QAAQ,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAUpD,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI;IAM7B,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC;IAYxB,UAAU,IAAI,WAAW,CAAC,CAAC,CAAC;CAO7B"}
|
360
@capacitor/cli/node_modules/glob/dist/cjs/walker.js
generated
vendored
Normal file
360
@capacitor/cli/node_modules/glob/dist/cjs/walker.js
generated
vendored
Normal file
|
@ -0,0 +1,360 @@
|
|||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GlobStream = exports.GlobWalker = exports.GlobUtil = void 0;
|
||||
/**
|
||||
* Single-use utility classes to provide functionality to the {@link Glob}
|
||||
* methods.
|
||||
*
|
||||
* @module
|
||||
*/
|
||||
const minipass_1 = __importDefault(require("minipass"));
|
||||
const ignore_js_1 = require("./ignore.js");
|
||||
const processor_js_1 = require("./processor.js");
|
||||
const makeIgnore = (ignore, opts) => typeof ignore === 'string'
|
||||
? new ignore_js_1.Ignore([ignore], opts)
|
||||
: Array.isArray(ignore)
|
||||
? new ignore_js_1.Ignore(ignore, opts)
|
||||
: ignore;
|
||||
/**
|
||||
* basic walking utilities that all the glob walker types use
|
||||
*/
|
||||
class GlobUtil {
|
||||
path;
|
||||
patterns;
|
||||
opts;
|
||||
seen = new Set();
|
||||
paused = false;
|
||||
aborted = false;
|
||||
#onResume = [];
|
||||
#ignore;
|
||||
#sep;
|
||||
signal;
|
||||
maxDepth;
|
||||
constructor(patterns, path, opts) {
|
||||
this.patterns = patterns;
|
||||
this.path = path;
|
||||
this.opts = opts;
|
||||
this.#sep = opts.platform === 'win32' ? '\\' : '/';
|
||||
if (opts.ignore) {
|
||||
this.#ignore = makeIgnore(opts.ignore, opts);
|
||||
}
|
||||
// ignore, always set with maxDepth, but it's optional on the
|
||||
// GlobOptions type
|
||||
/* c8 ignore start */
|
||||
this.maxDepth = opts.maxDepth || Infinity;
|
||||
/* c8 ignore stop */
|
||||
if (opts.signal) {
|
||||
this.signal = opts.signal;
|
||||
this.signal.addEventListener('abort', () => {
|
||||
this.#onResume.length = 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
#ignored(path) {
|
||||
return this.seen.has(path) || !!this.#ignore?.ignored?.(path);
|
||||
}
|
||||
#childrenIgnored(path) {
|
||||
return !!this.#ignore?.childrenIgnored?.(path);
|
||||
}
|
||||
// backpressure mechanism
|
||||
pause() {
|
||||
this.paused = true;
|
||||
}
|
||||
resume() {
|
||||
/* c8 ignore start */
|
||||
if (this.signal?.aborted)
|
||||
return;
|
||||
/* c8 ignore stop */
|
||||
this.paused = false;
|
||||
let fn = undefined;
|
||||
while (!this.paused && (fn = this.#onResume.shift())) {
|
||||
fn();
|
||||
}
|
||||
}
|
||||
onResume(fn) {
|
||||
if (this.signal?.aborted)
|
||||
return;
|
||||
/* c8 ignore start */
|
||||
if (!this.paused) {
|
||||
fn();
|
||||
}
|
||||
else {
|
||||
/* c8 ignore stop */
|
||||
this.#onResume.push(fn);
|
||||
}
|
||||
}
|
||||
// do the requisite realpath/stat checking, and return the path
|
||||
// to add or undefined to filter it out.
|
||||
async matchCheck(e, ifDir) {
|
||||
if (ifDir && this.opts.nodir)
|
||||
return undefined;
|
||||
let rpc;
|
||||
if (this.opts.realpath) {
|
||||
rpc = e.realpathCached() || (await e.realpath());
|
||||
if (!rpc)
|
||||
return undefined;
|
||||
e = rpc;
|
||||
}
|
||||
const needStat = e.isUnknown() || this.opts.stat;
|
||||
return this.matchCheckTest(needStat ? await e.lstat() : e, ifDir);
|
||||
}
|
||||
matchCheckTest(e, ifDir) {
|
||||
return e &&
|
||||
(this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&
|
||||
(!ifDir || e.canReaddir()) &&
|
||||
(!this.opts.nodir || !e.isDirectory()) &&
|
||||
!this.#ignored(e)
|
||||
? e
|
||||
: undefined;
|
||||
}
|
||||
matchCheckSync(e, ifDir) {
|
||||
if (ifDir && this.opts.nodir)
|
||||
return undefined;
|
||||
let rpc;
|
||||
if (this.opts.realpath) {
|
||||
rpc = e.realpathCached() || e.realpathSync();
|
||||
if (!rpc)
|
||||
return undefined;
|
||||
e = rpc;
|
||||
}
|
||||
const needStat = e.isUnknown() || this.opts.stat;
|
||||
return this.matchCheckTest(needStat ? e.lstatSync() : e, ifDir);
|
||||
}
|
||||
matchFinish(e, absolute) {
|
||||
if (this.#ignored(e))
|
||||
return;
|
||||
const abs = this.opts.absolute === undefined ? absolute : this.opts.absolute;
|
||||
this.seen.add(e);
|
||||
const mark = this.opts.mark && e.isDirectory() ? this.#sep : '';
|
||||
// ok, we have what we need!
|
||||
if (this.opts.withFileTypes) {
|
||||
this.matchEmit(e);
|
||||
}
|
||||
else if (abs) {
|
||||
this.matchEmit(e.fullpath() + mark);
|
||||
}
|
||||
else {
|
||||
const rel = e.relative();
|
||||
const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep)
|
||||
? '.' + this.#sep
|
||||
: '';
|
||||
this.matchEmit(!rel && mark ? '.' + mark : pre + rel + mark);
|
||||
}
|
||||
}
|
||||
async match(e, absolute, ifDir) {
|
||||
const p = await this.matchCheck(e, ifDir);
|
||||
if (p)
|
||||
this.matchFinish(p, absolute);
|
||||
}
|
||||
matchSync(e, absolute, ifDir) {
|
||||
const p = this.matchCheckSync(e, ifDir);
|
||||
if (p)
|
||||
this.matchFinish(p, absolute);
|
||||
}
|
||||
walkCB(target, patterns, cb) {
|
||||
/* c8 ignore start */
|
||||
if (this.signal?.aborted)
|
||||
cb();
|
||||
/* c8 ignore stop */
|
||||
this.walkCB2(target, patterns, new processor_js_1.Processor(this.opts), cb);
|
||||
}
|
||||
walkCB2(target, patterns, processor, cb) {
|
||||
if (this.#childrenIgnored(target))
|
||||
return cb();
|
||||
if (this.signal?.aborted)
|
||||
cb();
|
||||
if (this.paused) {
|
||||
this.onResume(() => this.walkCB2(target, patterns, processor, cb));
|
||||
return;
|
||||
}
|
||||
processor.processPatterns(target, patterns);
|
||||
// done processing. all of the above is sync, can be abstracted out.
|
||||
// subwalks is a map of paths to the entry filters they need
|
||||
// matches is a map of paths to [absolute, ifDir] tuples.
|
||||
let tasks = 1;
|
||||
const next = () => {
|
||||
if (--tasks === 0)
|
||||
cb();
|
||||
};
|
||||
for (const [m, absolute, ifDir] of processor.matches.entries()) {
|
||||
if (this.#ignored(m))
|
||||
continue;
|
||||
tasks++;
|
||||
this.match(m, absolute, ifDir).then(() => next());
|
||||
}
|
||||
for (const t of processor.subwalkTargets()) {
|
||||
if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
|
||||
continue;
|
||||
}
|
||||
tasks++;
|
||||
const childrenCached = t.readdirCached();
|
||||
if (t.calledReaddir())
|
||||
this.walkCB3(t, childrenCached, processor, next);
|
||||
else {
|
||||
t.readdirCB((_, entries) => this.walkCB3(t, entries, processor, next), true);
|
||||
}
|
||||
}
|
||||
next();
|
||||
}
|
||||
walkCB3(target, entries, processor, cb) {
|
||||
processor = processor.filterEntries(target, entries);
|
||||
let tasks = 1;
|
||||
const next = () => {
|
||||
if (--tasks === 0)
|
||||
cb();
|
||||
};
|
||||
for (const [m, absolute, ifDir] of processor.matches.entries()) {
|
||||
if (this.#ignored(m))
|
||||
continue;
|
||||
tasks++;
|
||||
this.match(m, absolute, ifDir).then(() => next());
|
||||
}
|
||||
for (const [target, patterns] of processor.subwalks.entries()) {
|
||||
tasks++;
|
||||
this.walkCB2(target, patterns, processor.child(), next);
|
||||
}
|
||||
next();
|
||||
}
|
||||
walkCBSync(target, patterns, cb) {
|
||||
/* c8 ignore start */
|
||||
if (this.signal?.aborted)
|
||||
cb();
|
||||
/* c8 ignore stop */
|
||||
this.walkCB2Sync(target, patterns, new processor_js_1.Processor(this.opts), cb);
|
||||
}
|
||||
walkCB2Sync(target, patterns, processor, cb) {
|
||||
if (this.#childrenIgnored(target))
|
||||
return cb();
|
||||
if (this.signal?.aborted)
|
||||
cb();
|
||||
if (this.paused) {
|
||||
this.onResume(() => this.walkCB2Sync(target, patterns, processor, cb));
|
||||
return;
|
||||
}
|
||||
processor.processPatterns(target, patterns);
|
||||
// done processing. all of the above is sync, can be abstracted out.
|
||||
// subwalks is a map of paths to the entry filters they need
|
||||
// matches is a map of paths to [absolute, ifDir] tuples.
|
||||
let tasks = 1;
|
||||
const next = () => {
|
||||
if (--tasks === 0)
|
||||
cb();
|
||||
};
|
||||
for (const [m, absolute, ifDir] of processor.matches.entries()) {
|
||||
if (this.#ignored(m))
|
||||
continue;
|
||||
this.matchSync(m, absolute, ifDir);
|
||||
}
|
||||
for (const t of processor.subwalkTargets()) {
|
||||
if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
|
||||
continue;
|
||||
}
|
||||
tasks++;
|
||||
const children = t.readdirSync();
|
||||
this.walkCB3Sync(t, children, processor, next);
|
||||
}
|
||||
next();
|
||||
}
|
||||
walkCB3Sync(target, entries, processor, cb) {
|
||||
processor = processor.filterEntries(target, entries);
|
||||
let tasks = 1;
|
||||
const next = () => {
|
||||
if (--tasks === 0)
|
||||
cb();
|
||||
};
|
||||
for (const [m, absolute, ifDir] of processor.matches.entries()) {
|
||||
if (this.#ignored(m))
|
||||
continue;
|
||||
this.matchSync(m, absolute, ifDir);
|
||||
}
|
||||
for (const [target, patterns] of processor.subwalks.entries()) {
|
||||
tasks++;
|
||||
this.walkCB2Sync(target, patterns, processor.child(), next);
|
||||
}
|
||||
next();
|
||||
}
|
||||
}
|
||||
exports.GlobUtil = GlobUtil;
|
||||
class GlobWalker extends GlobUtil {
|
||||
matches;
|
||||
constructor(patterns, path, opts) {
|
||||
super(patterns, path, opts);
|
||||
this.matches = new Set();
|
||||
}
|
||||
matchEmit(e) {
|
||||
this.matches.add(e);
|
||||
}
|
||||
async walk() {
|
||||
if (this.signal?.aborted)
|
||||
throw this.signal.reason;
|
||||
if (this.path.isUnknown()) {
|
||||
await this.path.lstat();
|
||||
}
|
||||
await new Promise((res, rej) => {
|
||||
this.walkCB(this.path, this.patterns, () => {
|
||||
if (this.signal?.aborted) {
|
||||
rej(this.signal.reason);
|
||||
}
|
||||
else {
|
||||
res(this.matches);
|
||||
}
|
||||
});
|
||||
});
|
||||
return this.matches;
|
||||
}
|
||||
walkSync() {
|
||||
if (this.signal?.aborted)
|
||||
throw this.signal.reason;
|
||||
if (this.path.isUnknown()) {
|
||||
this.path.lstatSync();
|
||||
}
|
||||
// nothing for the callback to do, because this never pauses
|
||||
this.walkCBSync(this.path, this.patterns, () => {
|
||||
if (this.signal?.aborted)
|
||||
throw this.signal.reason;
|
||||
});
|
||||
return this.matches;
|
||||
}
|
||||
}
|
||||
exports.GlobWalker = GlobWalker;
|
||||
class GlobStream extends GlobUtil {
|
||||
results;
|
||||
constructor(patterns, path, opts) {
|
||||
super(patterns, path, opts);
|
||||
this.results = new minipass_1.default({
|
||||
signal: this.signal,
|
||||
objectMode: true,
|
||||
});
|
||||
this.results.on('drain', () => this.resume());
|
||||
this.results.on('resume', () => this.resume());
|
||||
}
|
||||
matchEmit(e) {
|
||||
this.results.write(e);
|
||||
if (!this.results.flowing)
|
||||
this.pause();
|
||||
}
|
||||
stream() {
|
||||
const target = this.path;
|
||||
if (target.isUnknown()) {
|
||||
target.lstat().then(() => {
|
||||
this.walkCB(target, this.patterns, () => this.results.end());
|
||||
});
|
||||
}
|
||||
else {
|
||||
this.walkCB(target, this.patterns, () => this.results.end());
|
||||
}
|
||||
return this.results;
|
||||
}
|
||||
streamSync() {
|
||||
if (this.path.isUnknown()) {
|
||||
this.path.lstatSync();
|
||||
}
|
||||
this.walkCBSync(this.path, this.patterns, () => this.results.end());
|
||||
return this.results;
|
||||
}
|
||||
}
|
||||
exports.GlobStream = GlobStream;
|
||||
//# sourceMappingURL=walker.js.map
|
1
@capacitor/cli/node_modules/glob/dist/cjs/walker.js.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/cjs/walker.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
333
@capacitor/cli/node_modules/glob/dist/mjs/glob.d.ts
generated
vendored
Normal file
333
@capacitor/cli/node_modules/glob/dist/mjs/glob.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,333 @@
|
|||
/// <reference types="node" />
|
||||
import { Minimatch } from 'minimatch';
|
||||
import Minipass from 'minipass';
|
||||
import { FSOption, Path, PathScurry } from 'path-scurry';
|
||||
import { IgnoreLike } from './ignore.js';
|
||||
import { Pattern } from './pattern.js';
|
||||
export type MatchSet = Minimatch['set'];
|
||||
export type GlobParts = Exclude<Minimatch['globParts'], undefined>;
|
||||
/**
|
||||
* A `GlobOptions` object may be provided to any of the exported methods, and
|
||||
* must be provided to the `Glob` constructor.
|
||||
*
|
||||
* All options are optional, boolean, and false by default, unless otherwise
|
||||
* noted.
|
||||
*
|
||||
* All resolved options are added to the Glob object as properties.
|
||||
*
|
||||
* If you are running many `glob` operations, you can pass a Glob object as the
|
||||
* `options` argument to a subsequent operation to share the previously loaded
|
||||
* cache.
|
||||
*/
|
||||
export interface GlobOptions {
|
||||
/**
|
||||
* Set to `true` to always receive absolute paths for
|
||||
* matched files. Set to `false` to always return relative paths.
|
||||
*
|
||||
* When this option is not set, absolute paths are returned for patterns
|
||||
* that are absolute, and otherwise paths are returned that are relative
|
||||
* to the `cwd` setting.
|
||||
*
|
||||
* This does _not_ make an extra system call to get
|
||||
* the realpath, it only does string path resolution.
|
||||
*
|
||||
* Conflicts with {@link withFileTypes}
|
||||
*/
|
||||
absolute?: boolean;
|
||||
/**
|
||||
* Set to false to enable {@link windowsPathsNoEscape}
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
allowWindowsEscape?: boolean;
|
||||
/**
|
||||
* The current working directory in which to search. Defaults to
|
||||
* `process.cwd()`.
|
||||
*
|
||||
* May be eiher a string path or a `file://` URL object or string.
|
||||
*/
|
||||
cwd?: string | URL;
|
||||
/**
|
||||
* Include `.dot` files in normal matches and `globstar`
|
||||
* matches. Note that an explicit dot in a portion of the pattern
|
||||
* will always match dot files.
|
||||
*/
|
||||
dot?: boolean;
|
||||
/**
|
||||
* Prepend all relative path strings with `./` (or `.\` on Windows).
|
||||
*
|
||||
* Without this option, returned relative paths are "bare", so instead of
|
||||
* returning `'./foo/bar'`, they are returned as `'foo/bar'`.
|
||||
*
|
||||
* Relative patterns starting with `'../'` are not prepended with `./`, even
|
||||
* if this option is set.
|
||||
*/
|
||||
dotRelative?: boolean;
|
||||
/**
|
||||
* Follow symlinked directories when expanding `**`
|
||||
* patterns. This can result in a lot of duplicate references in
|
||||
* the presence of cyclic links, and make performance quite bad.
|
||||
*
|
||||
* By default, a `**` in a pattern will follow 1 symbolic link if
|
||||
* it is not the first item in the pattern, or none if it is the
|
||||
* first item in the pattern, following the same behavior as Bash.
|
||||
*/
|
||||
follow?: boolean;
|
||||
/**
|
||||
* string or string[], or an object with `ignore` and `ignoreChildren`
|
||||
* methods.
|
||||
*
|
||||
* If a string or string[] is provided, then this is treated as a glob
|
||||
* pattern or array of glob patterns to exclude from matches. To ignore all
|
||||
* children within a directory, as well as the entry itself, append `'/**'`
|
||||
* to the ignore pattern.
|
||||
*
|
||||
* **Note** `ignore` patterns are _always_ in `dot:true` mode, regardless of
|
||||
* any other settings.
|
||||
*
|
||||
* If an object is provided that has `ignored(path)` and/or
|
||||
* `childrenIgnored(path)` methods, then these methods will be called to
|
||||
* determine whether any Path is a match or if its children should be
|
||||
* traversed, respectively.
|
||||
*/
|
||||
ignore?: string | string[] | IgnoreLike;
|
||||
/**
|
||||
* Treat brace expansion like `{a,b}` as a "magic" pattern. Has no
|
||||
* effect if {@link nobrace} is set.
|
||||
*
|
||||
* Only has effect on the {@link hasMagic} function.
|
||||
*/
|
||||
magicalBraces?: boolean;
|
||||
/**
|
||||
* Add a `/` character to directory matches. Note that this requires
|
||||
* additional stat calls in some cases.
|
||||
*/
|
||||
mark?: boolean;
|
||||
/**
|
||||
* Perform a basename-only match if the pattern does not contain any slash
|
||||
* characters. That is, `*.js` would be treated as equivalent to
|
||||
* `**\/*.js`, matching all js files in all directories.
|
||||
*/
|
||||
matchBase?: boolean;
|
||||
/**
|
||||
* Limit the directory traversal to a given depth below the cwd.
|
||||
* Note that this does NOT prevent traversal to sibling folders,
|
||||
* root patterns, and so on. It only limits the maximum folder depth
|
||||
* that the walk will descend, relative to the cwd.
|
||||
*/
|
||||
maxDepth?: number;
|
||||
/**
|
||||
* Do not expand `{a,b}` and `{1..3}` brace sets.
|
||||
*/
|
||||
nobrace?: boolean;
|
||||
/**
|
||||
* Perform a case-insensitive match. This defaults to `true` on macOS and
|
||||
* Windows systems, and `false` on all others.
|
||||
*
|
||||
* **Note** `nocase` should only be explicitly set when it is
|
||||
* known that the filesystem's case sensitivity differs from the
|
||||
* platform default. If set `true` on case-sensitive file
|
||||
* systems, or `false` on case-insensitive file systems, then the
|
||||
* walk may return more or less results than expected.
|
||||
*/
|
||||
nocase?: boolean;
|
||||
/**
|
||||
* Do not match directories, only files. (Note: to match
|
||||
* _only_ directories, put a `/` at the end of the pattern.)
|
||||
*/
|
||||
nodir?: boolean;
|
||||
/**
|
||||
* Do not match "extglob" patterns such as `+(a|b)`.
|
||||
*/
|
||||
noext?: boolean;
|
||||
/**
|
||||
* Do not match `**` against multiple filenames. (Ie, treat it as a normal
|
||||
* `*` instead.)
|
||||
*
|
||||
* Conflicts with {@link matchBase}
|
||||
*/
|
||||
noglobstar?: boolean;
|
||||
/**
|
||||
* Defaults to value of `process.platform` if available, or `'linux'` if
|
||||
* not. Setting `platform:'win32'` on non-Windows systems may cause strange
|
||||
* behavior.
|
||||
*/
|
||||
platform?: NodeJS.Platform;
|
||||
/**
|
||||
* Set to true to call `fs.realpath` on all of the
|
||||
* results. In the case of an entry that cannot be resolved, the
|
||||
* entry is omitted. This incurs a slight performance penalty, of
|
||||
* course, because of the added system calls.
|
||||
*/
|
||||
realpath?: boolean;
|
||||
/**
|
||||
*
|
||||
* A string path resolved against the `cwd` option, which
|
||||
* is used as the starting point for absolute patterns that start
|
||||
* with `/`, (but not drive letters or UNC paths on Windows).
|
||||
*
|
||||
* Note that this _doesn't_ necessarily limit the walk to the
|
||||
* `root` directory, and doesn't affect the cwd starting point for
|
||||
* non-absolute patterns. A pattern containing `..` will still be
|
||||
* able to traverse out of the root directory, if it is not an
|
||||
* actual root directory on the filesystem, and any non-absolute
|
||||
* patterns will be matched in the `cwd`. For example, the
|
||||
* pattern `/../*` with `{root:'/some/path'}` will return all
|
||||
* files in `/some`, not all files in `/some/path`. The pattern
|
||||
* `*` with `{root:'/some/path'}` will return all the entries in
|
||||
* the cwd, not the entries in `/some/path`.
|
||||
*
|
||||
* To start absolute and non-absolute patterns in the same
|
||||
* path, you can use `{root:''}`. However, be aware that on
|
||||
* Windows systems, a pattern like `x:/*` or `//host/share/*` will
|
||||
* _always_ start in the `x:/` or `//host/share` directory,
|
||||
* regardless of the `root` setting.
|
||||
*/
|
||||
root?: string;
|
||||
/**
|
||||
* A [PathScurry](http://npm.im/path-scurry) object used
|
||||
* to traverse the file system. If the `nocase` option is set
|
||||
* explicitly, then any provided `scurry` object must match this
|
||||
* setting.
|
||||
*/
|
||||
scurry?: PathScurry;
|
||||
/**
|
||||
* Call `lstat()` on all entries, whether required or not to determine
|
||||
* whether it's a valid match. When used with {@link withFileTypes}, this
|
||||
* means that matches will include data such as modified time, permissions,
|
||||
* and so on. Note that this will incur a performance cost due to the added
|
||||
* system calls.
|
||||
*/
|
||||
stat?: boolean;
|
||||
/**
|
||||
* An AbortSignal which will cancel the Glob walk when
|
||||
* triggered.
|
||||
*/
|
||||
signal?: AbortSignal;
|
||||
/**
|
||||
* 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 Glob v7 and before on Windows. Please use with
|
||||
* caution, and be mindful of [the caveat below about Windows
|
||||
* paths](#windows). (For legacy reasons, this is also set if
|
||||
* `allowWindowsEscape` is set to the exact value `false`.)
|
||||
*/
|
||||
windowsPathsNoEscape?: boolean;
|
||||
/**
|
||||
* Return [PathScurry](http://npm.im/path-scurry)
|
||||
* `Path` objects instead of strings. These are similar to a
|
||||
* NodeJS `Dirent` object, but with additional methods and
|
||||
* properties.
|
||||
*
|
||||
* Conflicts with {@link absolute}
|
||||
*/
|
||||
withFileTypes?: boolean;
|
||||
/**
|
||||
* An fs implementation to override some or all of the defaults. See
|
||||
* http://npm.im/path-scurry for details about what can be overridden.
|
||||
*/
|
||||
fs?: FSOption;
|
||||
/**
|
||||
* Just passed along to Minimatch. Note that this makes all pattern
|
||||
* matching operations slower and *extremely* noisy.
|
||||
*/
|
||||
debug?: boolean;
|
||||
}
|
||||
export type GlobOptionsWithFileTypesTrue = GlobOptions & {
|
||||
withFileTypes: true;
|
||||
absolute?: undefined;
|
||||
};
|
||||
export type GlobOptionsWithFileTypesFalse = GlobOptions & {
|
||||
withFileTypes?: false;
|
||||
};
|
||||
export type GlobOptionsWithFileTypesUnset = GlobOptions & {
|
||||
withFileTypes?: undefined;
|
||||
};
|
||||
export type Result<Opts> = Opts extends GlobOptionsWithFileTypesTrue ? Path : Opts extends GlobOptionsWithFileTypesFalse ? string : Opts extends GlobOptionsWithFileTypesUnset ? string : string | Path;
|
||||
export type Results<Opts> = Result<Opts>[];
|
||||
export type FileTypes<Opts> = Opts extends GlobOptionsWithFileTypesTrue ? true : Opts extends GlobOptionsWithFileTypesFalse ? false : Opts extends GlobOptionsWithFileTypesUnset ? false : boolean;
|
||||
/**
|
||||
* An object that can perform glob pattern traversals.
|
||||
*/
|
||||
export declare class Glob<Opts extends GlobOptions> implements GlobOptions {
|
||||
absolute?: boolean;
|
||||
cwd: string;
|
||||
root?: string;
|
||||
dot: boolean;
|
||||
dotRelative: boolean;
|
||||
follow: boolean;
|
||||
ignore?: string | string[] | IgnoreLike;
|
||||
magicalBraces: boolean;
|
||||
mark?: boolean;
|
||||
matchBase: boolean;
|
||||
maxDepth: number;
|
||||
nobrace: boolean;
|
||||
nocase: boolean;
|
||||
nodir: boolean;
|
||||
noext: boolean;
|
||||
noglobstar: boolean;
|
||||
pattern: string[];
|
||||
platform: NodeJS.Platform;
|
||||
realpath: boolean;
|
||||
scurry: PathScurry;
|
||||
stat: boolean;
|
||||
signal?: AbortSignal;
|
||||
windowsPathsNoEscape: boolean;
|
||||
withFileTypes: FileTypes<Opts>;
|
||||
/**
|
||||
* The options provided to the constructor.
|
||||
*/
|
||||
opts: Opts;
|
||||
/**
|
||||
* An array of parsed immutable {@link Pattern} objects.
|
||||
*/
|
||||
patterns: Pattern[];
|
||||
/**
|
||||
* All options are stored as properties on the `Glob` object.
|
||||
*
|
||||
* See {@link GlobOptions} for full options descriptions.
|
||||
*
|
||||
* Note that a previous `Glob` object can be passed as the
|
||||
* `GlobOptions` to another `Glob` instantiation to re-use settings
|
||||
* and caches with a new pattern.
|
||||
*
|
||||
* Traversal functions can be called multiple times to run the walk
|
||||
* again.
|
||||
*/
|
||||
constructor(pattern: string | string[], opts: Opts);
|
||||
/**
|
||||
* Returns a Promise that resolves to the results array.
|
||||
*/
|
||||
walk(): Promise<Results<Opts>>;
|
||||
/**
|
||||
* synchronous {@link Glob.walk}
|
||||
*/
|
||||
walkSync(): Results<Opts>;
|
||||
/**
|
||||
* Stream results asynchronously.
|
||||
*/
|
||||
stream(): Minipass<Result<Opts>, Result<Opts>>;
|
||||
/**
|
||||
* Stream results synchronously.
|
||||
*/
|
||||
streamSync(): Minipass<Result<Opts>, Result<Opts>>;
|
||||
/**
|
||||
* Default sync iteration function. Returns a Generator that
|
||||
* iterates over the results.
|
||||
*/
|
||||
iterateSync(): Generator<Result<Opts>, void, void>;
|
||||
[Symbol.iterator](): Generator<Result<Opts>, void, void>;
|
||||
/**
|
||||
* Default async iteration function. Returns an AsyncGenerator that
|
||||
* iterates over the results.
|
||||
*/
|
||||
iterate(): AsyncGenerator<Result<Opts>, void, void>;
|
||||
[Symbol.asyncIterator](): AsyncGenerator<Result<Opts>, void, void>;
|
||||
}
|
||||
//# sourceMappingURL=glob.d.ts.map
|
1
@capacitor/cli/node_modules/glob/dist/mjs/glob.d.ts.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/mjs/glob.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAA;AACvD,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,UAAU,EAIX,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGtC,MAAM,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;AACvC,MAAM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AAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAalD;;;OAGG;IACH,WAAW,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGlD,CAAC,MAAM,CAAC,QAAQ,CAAC;IAIjB;;;OAGG;IACH,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGnD,CAAC,MAAM,CAAC,aAAa,CAAC;CAGvB"}
|
225
@capacitor/cli/node_modules/glob/dist/mjs/glob.js
generated
vendored
Normal file
225
@capacitor/cli/node_modules/glob/dist/mjs/glob.js
generated
vendored
Normal file
|
@ -0,0 +1,225 @@
|
|||
import { Minimatch } from 'minimatch';
|
||||
import { PathScurry, PathScurryDarwin, PathScurryPosix, PathScurryWin32, } from 'path-scurry';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { Pattern } from './pattern.js';
|
||||
import { GlobStream, GlobWalker } from './walker.js';
|
||||
// if no process global, just call it linux.
|
||||
// so we default to case-sensitive, / separators
|
||||
const defaultPlatform = typeof process === 'object' &&
|
||||
process &&
|
||||
typeof process.platform === 'string'
|
||||
? process.platform
|
||||
: 'linux';
|
||||
/**
|
||||
* An object that can perform glob pattern traversals.
|
||||
*/
|
||||
export class Glob {
|
||||
absolute;
|
||||
cwd;
|
||||
root;
|
||||
dot;
|
||||
dotRelative;
|
||||
follow;
|
||||
ignore;
|
||||
magicalBraces;
|
||||
mark;
|
||||
matchBase;
|
||||
maxDepth;
|
||||
nobrace;
|
||||
nocase;
|
||||
nodir;
|
||||
noext;
|
||||
noglobstar;
|
||||
pattern;
|
||||
platform;
|
||||
realpath;
|
||||
scurry;
|
||||
stat;
|
||||
signal;
|
||||
windowsPathsNoEscape;
|
||||
withFileTypes;
|
||||
/**
|
||||
* The options provided to the constructor.
|
||||
*/
|
||||
opts;
|
||||
/**
|
||||
* An array of parsed immutable {@link Pattern} objects.
|
||||
*/
|
||||
patterns;
|
||||
/**
|
||||
* All options are stored as properties on the `Glob` object.
|
||||
*
|
||||
* See {@link GlobOptions} for full options descriptions.
|
||||
*
|
||||
* Note that a previous `Glob` object can be passed as the
|
||||
* `GlobOptions` to another `Glob` instantiation to re-use settings
|
||||
* and caches with a new pattern.
|
||||
*
|
||||
* Traversal functions can be called multiple times to run the walk
|
||||
* again.
|
||||
*/
|
||||
constructor(pattern, opts) {
|
||||
this.withFileTypes = !!opts.withFileTypes;
|
||||
this.signal = opts.signal;
|
||||
this.follow = !!opts.follow;
|
||||
this.dot = !!opts.dot;
|
||||
this.dotRelative = !!opts.dotRelative;
|
||||
this.nodir = !!opts.nodir;
|
||||
this.mark = !!opts.mark;
|
||||
if (!opts.cwd) {
|
||||
this.cwd = '';
|
||||
}
|
||||
else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {
|
||||
opts.cwd = fileURLToPath(opts.cwd);
|
||||
}
|
||||
this.cwd = opts.cwd || '';
|
||||
this.root = opts.root;
|
||||
this.magicalBraces = !!opts.magicalBraces;
|
||||
this.nobrace = !!opts.nobrace;
|
||||
this.noext = !!opts.noext;
|
||||
this.realpath = !!opts.realpath;
|
||||
this.absolute = opts.absolute;
|
||||
this.noglobstar = !!opts.noglobstar;
|
||||
this.matchBase = !!opts.matchBase;
|
||||
this.maxDepth =
|
||||
typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity;
|
||||
this.stat = !!opts.stat;
|
||||
this.ignore = opts.ignore;
|
||||
if (this.withFileTypes && this.absolute !== undefined) {
|
||||
throw new Error('cannot set absolute and withFileTypes:true');
|
||||
}
|
||||
if (typeof pattern === 'string') {
|
||||
pattern = [pattern];
|
||||
}
|
||||
this.windowsPathsNoEscape =
|
||||
!!opts.windowsPathsNoEscape ||
|
||||
opts.allowWindowsEscape === false;
|
||||
if (this.windowsPathsNoEscape) {
|
||||
pattern = pattern.map(p => p.replace(/\\/g, '/'));
|
||||
}
|
||||
if (this.matchBase) {
|
||||
if (opts.noglobstar) {
|
||||
throw new TypeError('base matching requires globstar');
|
||||
}
|
||||
pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`));
|
||||
}
|
||||
this.pattern = pattern;
|
||||
this.platform = opts.platform || defaultPlatform;
|
||||
this.opts = { ...opts, platform: this.platform };
|
||||
if (opts.scurry) {
|
||||
this.scurry = opts.scurry;
|
||||
if (opts.nocase !== undefined &&
|
||||
opts.nocase !== opts.scurry.nocase) {
|
||||
throw new Error('nocase option contradicts provided scurry option');
|
||||
}
|
||||
}
|
||||
else {
|
||||
const Scurry = opts.platform === 'win32'
|
||||
? PathScurryWin32
|
||||
: opts.platform === 'darwin'
|
||||
? PathScurryDarwin
|
||||
: opts.platform
|
||||
? PathScurryPosix
|
||||
: PathScurry;
|
||||
this.scurry = new Scurry(this.cwd, {
|
||||
nocase: opts.nocase,
|
||||
fs: opts.fs,
|
||||
});
|
||||
}
|
||||
this.nocase = this.scurry.nocase;
|
||||
const mmo = {
|
||||
// default nocase based on platform
|
||||
...opts,
|
||||
dot: this.dot,
|
||||
matchBase: this.matchBase,
|
||||
nobrace: this.nobrace,
|
||||
nocase: this.nocase,
|
||||
nocaseMagicOnly: true,
|
||||
nocomment: true,
|
||||
noext: this.noext,
|
||||
nonegate: true,
|
||||
optimizationLevel: 2,
|
||||
platform: this.platform,
|
||||
windowsPathsNoEscape: this.windowsPathsNoEscape,
|
||||
debug: !!this.opts.debug,
|
||||
};
|
||||
const mms = this.pattern.map(p => new Minimatch(p, mmo));
|
||||
const [matchSet, globParts] = mms.reduce((set, m) => {
|
||||
set[0].push(...m.set);
|
||||
set[1].push(...m.globParts);
|
||||
return set;
|
||||
}, [[], []]);
|
||||
this.patterns = matchSet.map((set, i) => {
|
||||
return new Pattern(set, globParts[i], 0, this.platform);
|
||||
});
|
||||
}
|
||||
async walk() {
|
||||
// Walkers always return array of Path objects, so we just have to
|
||||
// coerce them into the right shape. It will have already called
|
||||
// realpath() if the option was set to do so, so we know that's cached.
|
||||
// start out knowing the cwd, at least
|
||||
return [
|
||||
...(await new GlobWalker(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity
|
||||
? this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
}).walk()),
|
||||
];
|
||||
}
|
||||
walkSync() {
|
||||
return [
|
||||
...new GlobWalker(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity
|
||||
? this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
}).walkSync(),
|
||||
];
|
||||
}
|
||||
stream() {
|
||||
return new GlobStream(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity
|
||||
? this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
}).stream();
|
||||
}
|
||||
streamSync() {
|
||||
return new GlobStream(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity
|
||||
? this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
}).streamSync();
|
||||
}
|
||||
/**
|
||||
* Default sync iteration function. Returns a Generator that
|
||||
* iterates over the results.
|
||||
*/
|
||||
iterateSync() {
|
||||
return this.streamSync()[Symbol.iterator]();
|
||||
}
|
||||
[Symbol.iterator]() {
|
||||
return this.iterateSync();
|
||||
}
|
||||
/**
|
||||
* Default async iteration function. Returns an AsyncGenerator that
|
||||
* iterates over the results.
|
||||
*/
|
||||
iterate() {
|
||||
return this.stream()[Symbol.asyncIterator]();
|
||||
}
|
||||
[Symbol.asyncIterator]() {
|
||||
return this.iterate();
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=glob.js.map
|
1
@capacitor/cli/node_modules/glob/dist/mjs/glob.js.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/mjs/glob.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
14
@capacitor/cli/node_modules/glob/dist/mjs/has-magic.d.ts
generated
vendored
Normal file
14
@capacitor/cli/node_modules/glob/dist/mjs/has-magic.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
import { GlobOptions } from './glob.js';
|
||||
/**
|
||||
* Return true if the patterns provided contain any magic glob characters,
|
||||
* given the options provided.
|
||||
*
|
||||
* Brace expansion is not considered "magic" unless the `magicalBraces` option
|
||||
* is set, as brace expansion just turns one string into an array of strings.
|
||||
* So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and
|
||||
* `'xby'` both do not contain any magic glob characters, and it's treated the
|
||||
* same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`
|
||||
* is in the options, brace expansion _is_ treated as a pattern having magic.
|
||||
*/
|
||||
export declare const hasMagic: (pattern: string | string[], options?: GlobOptions) => boolean;
|
||||
//# sourceMappingURL=has-magic.d.ts.map
|
1
@capacitor/cli/node_modules/glob/dist/mjs/has-magic.d.ts.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/mjs/has-magic.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"has-magic.d.ts","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,YACV,MAAM,GAAG,MAAM,EAAE,YACjB,WAAW,KACnB,OAQF,CAAA"}
|
23
@capacitor/cli/node_modules/glob/dist/mjs/has-magic.js
generated
vendored
Normal file
23
@capacitor/cli/node_modules/glob/dist/mjs/has-magic.js
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
import { Minimatch } from 'minimatch';
|
||||
/**
|
||||
* Return true if the patterns provided contain any magic glob characters,
|
||||
* given the options provided.
|
||||
*
|
||||
* Brace expansion is not considered "magic" unless the `magicalBraces` option
|
||||
* is set, as brace expansion just turns one string into an array of strings.
|
||||
* So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and
|
||||
* `'xby'` both do not contain any magic glob characters, and it's treated the
|
||||
* same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`
|
||||
* is in the options, brace expansion _is_ treated as a pattern having magic.
|
||||
*/
|
||||
export const hasMagic = (pattern, options = {}) => {
|
||||
if (!Array.isArray(pattern)) {
|
||||
pattern = [pattern];
|
||||
}
|
||||
for (const p of pattern) {
|
||||
if (new Minimatch(p, options).hasMagic())
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
//# sourceMappingURL=has-magic.js.map
|
1
@capacitor/cli/node_modules/glob/dist/mjs/has-magic.js.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/mjs/has-magic.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"has-magic.js","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAGrC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,OAA0B,EAC1B,UAAuB,EAAE,EAChB,EAAE;IACX,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC3B,OAAO,GAAG,CAAC,OAAO,CAAC,CAAA;KACpB;IACD,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE;QACvB,IAAI,IAAI,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE;YAAE,OAAO,IAAI,CAAA;KACtD;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA","sourcesContent":["import { Minimatch } from 'minimatch'\nimport { GlobOptions } from './glob.js'\n\n/**\n * Return true if the patterns provided contain any magic glob characters,\n * given the options provided.\n *\n * Brace expansion is not considered \"magic\" unless the `magicalBraces` option\n * is set, as brace expansion just turns one string into an array of strings.\n * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and\n * `'xby'` both do not contain any magic glob characters, and it's treated the\n * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`\n * is in the options, brace expansion _is_ treated as a pattern having magic.\n */\nexport const hasMagic = (\n pattern: string | string[],\n options: GlobOptions = {}\n): boolean => {\n if (!Array.isArray(pattern)) {\n pattern = [pattern]\n }\n for (const p of pattern) {\n if (new Minimatch(p, options).hasMagic()) return true\n }\n return false\n}\n"]}
|
20
@capacitor/cli/node_modules/glob/dist/mjs/ignore.d.ts
generated
vendored
Normal file
20
@capacitor/cli/node_modules/glob/dist/mjs/ignore.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { Minimatch } from 'minimatch';
|
||||
import { Path } from 'path-scurry';
|
||||
import { GlobWalkerOpts } from './walker.js';
|
||||
export interface IgnoreLike {
|
||||
ignored?: (p: Path) => boolean;
|
||||
childrenIgnored?: (p: Path) => boolean;
|
||||
}
|
||||
/**
|
||||
* Class used to process ignored patterns
|
||||
*/
|
||||
export declare class Ignore implements IgnoreLike {
|
||||
relative: Minimatch[];
|
||||
relativeChildren: Minimatch[];
|
||||
absolute: Minimatch[];
|
||||
absoluteChildren: Minimatch[];
|
||||
constructor(ignored: string[], { nobrace, nocase, noext, noglobstar, platform, }: GlobWalkerOpts);
|
||||
ignored(p: Path): boolean;
|
||||
childrenIgnored(p: Path): boolean;
|
||||
}
|
||||
//# sourceMappingURL=ignore.d.ts.map
|
1
@capacitor/cli/node_modules/glob/dist/mjs/ignore.d.ts.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/mjs/ignore.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"ignore.d.ts","sourceRoot":"","sources":["../../src/ignore.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IAC9B,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;CACvC;AASD;;GAEG;AACH,qBAAa,MAAO,YAAW,UAAU;IACvC,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;IAC7B,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;gBAG3B,OAAO,EAAE,MAAM,EAAE,EACjB,EACE,OAAO,EACP,MAAM,EACN,KAAK,EACL,UAAU,EACV,QAA0B,GAC3B,EAAE,cAAc;IAiDnB,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;IAczB,eAAe,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;CAWlC"}
|
99
@capacitor/cli/node_modules/glob/dist/mjs/ignore.js
generated
vendored
Normal file
99
@capacitor/cli/node_modules/glob/dist/mjs/ignore.js
generated
vendored
Normal file
|
@ -0,0 +1,99 @@
|
|||
// give it a pattern, and it'll be able to tell you if
|
||||
// a given path should be ignored.
|
||||
// Ignoring a path ignores its children if the pattern ends in /**
|
||||
// Ignores are always parsed in dot:true mode
|
||||
import { Minimatch } from 'minimatch';
|
||||
import { Pattern } from './pattern.js';
|
||||
const defaultPlatform = typeof process === 'object' &&
|
||||
process &&
|
||||
typeof process.platform === 'string'
|
||||
? process.platform
|
||||
: 'linux';
|
||||
/**
|
||||
* Class used to process ignored patterns
|
||||
*/
|
||||
export class Ignore {
|
||||
relative;
|
||||
relativeChildren;
|
||||
absolute;
|
||||
absoluteChildren;
|
||||
constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = defaultPlatform, }) {
|
||||
this.relative = [];
|
||||
this.absolute = [];
|
||||
this.relativeChildren = [];
|
||||
this.absoluteChildren = [];
|
||||
const mmopts = {
|
||||
dot: true,
|
||||
nobrace,
|
||||
nocase,
|
||||
noext,
|
||||
noglobstar,
|
||||
optimizationLevel: 2,
|
||||
platform,
|
||||
nocomment: true,
|
||||
nonegate: true,
|
||||
};
|
||||
// this is a little weird, but it gives us a clean set of optimized
|
||||
// minimatch matchers, without getting tripped up if one of them
|
||||
// ends in /** inside a brace section, and it's only inefficient at
|
||||
// the start of the walk, not along it.
|
||||
// It'd be nice if the Pattern class just had a .test() method, but
|
||||
// handling globstars is a bit of a pita, and that code already lives
|
||||
// in minimatch anyway.
|
||||
// Another way would be if maybe Minimatch could take its set/globParts
|
||||
// as an option, and then we could at least just use Pattern to test
|
||||
// for absolute-ness.
|
||||
// Yet another way, Minimatch could take an array of glob strings, and
|
||||
// a cwd option, and do the right thing.
|
||||
for (const ign of ignored) {
|
||||
const mm = new Minimatch(ign, mmopts);
|
||||
for (let i = 0; i < mm.set.length; i++) {
|
||||
const parsed = mm.set[i];
|
||||
const globParts = mm.globParts[i];
|
||||
const p = new Pattern(parsed, globParts, 0, platform);
|
||||
const m = new Minimatch(p.globString(), mmopts);
|
||||
const children = globParts[globParts.length - 1] === '**';
|
||||
const absolute = p.isAbsolute();
|
||||
if (absolute)
|
||||
this.absolute.push(m);
|
||||
else
|
||||
this.relative.push(m);
|
||||
if (children) {
|
||||
if (absolute)
|
||||
this.absoluteChildren.push(m);
|
||||
else
|
||||
this.relativeChildren.push(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ignored(p) {
|
||||
const fullpath = p.fullpath();
|
||||
const fullpaths = `${fullpath}/`;
|
||||
const relative = p.relative() || '.';
|
||||
const relatives = `${relative}/`;
|
||||
for (const m of this.relative) {
|
||||
if (m.match(relative) || m.match(relatives))
|
||||
return true;
|
||||
}
|
||||
for (const m of this.absolute) {
|
||||
if (m.match(fullpath) || m.match(fullpaths))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
childrenIgnored(p) {
|
||||
const fullpath = p.fullpath() + '/';
|
||||
const relative = (p.relative() || '.') + '/';
|
||||
for (const m of this.relativeChildren) {
|
||||
if (m.match(relative))
|
||||
return true;
|
||||
}
|
||||
for (const m of this.absoluteChildren) {
|
||||
if (m.match(fullpath))
|
||||
true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=ignore.js.map
|
1
@capacitor/cli/node_modules/glob/dist/mjs/ignore.js.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/mjs/ignore.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
96
@capacitor/cli/node_modules/glob/dist/mjs/index.d.ts
generated
vendored
Normal file
96
@capacitor/cli/node_modules/glob/dist/mjs/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,96 @@
|
|||
import Minipass from 'minipass';
|
||||
import { Path } from 'path-scurry';
|
||||
import type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset } from './glob.js';
|
||||
import { Glob } from './glob.js';
|
||||
/**
|
||||
* Syncronous form of {@link globStream}. Will read all the matches as fast as
|
||||
* you consume them, even all in a single tick if you consume them immediately,
|
||||
* but will still respond to backpressure if they're not consumed immediately.
|
||||
*/
|
||||
export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass<Path, Path>;
|
||||
export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass<string, string>;
|
||||
export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesUnset): Minipass<string, string>;
|
||||
export declare function globStreamSync(pattern: string | string[], options: GlobOptions): Minipass<Path, Path> | Minipass<string, string>;
|
||||
/**
|
||||
* Return a stream that emits all the strings or `Path` objects and
|
||||
* then emits `end` when completed.
|
||||
*/
|
||||
export declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass<string, string>;
|
||||
export declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass<Path, Path>;
|
||||
export declare function globStream(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Minipass<string, string>;
|
||||
export declare function globStream(pattern: string | string[], options: GlobOptions): Minipass<Path, Path> | Minipass<string, string>;
|
||||
/**
|
||||
* Synchronous form of {@link glob}
|
||||
*/
|
||||
export declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): string[];
|
||||
export declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Path[];
|
||||
export declare function globSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): string[];
|
||||
export declare function globSync(pattern: string | string[], options: GlobOptions): Path[] | string[];
|
||||
/**
|
||||
* Perform an asynchronous glob search for the pattern(s) specified. Returns
|
||||
* [Path](https://isaacs.github.io/path-scurry/classes/PathBase) objects if the
|
||||
* {@link withFileTypes} option is set to `true`. See {@link GlobOptions} for
|
||||
* full option descriptions.
|
||||
*/
|
||||
export declare function glob(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Promise<string[]>;
|
||||
export declare function glob(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Promise<Path[]>;
|
||||
export declare function glob(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Promise<string[]>;
|
||||
export declare function glob(pattern: string | string[], options: GlobOptions): Promise<Path[] | string[]>;
|
||||
/**
|
||||
* Return a sync iterator for walking glob pattern matches.
|
||||
*/
|
||||
export declare function globIterateSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Generator<string, void, void>;
|
||||
export declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Generator<Path, void, void>;
|
||||
export declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Generator<string, void, void>;
|
||||
export declare function globIterateSync(pattern: string | string[], options: GlobOptions): Generator<Path, void, void> | Generator<string, void, void>;
|
||||
/**
|
||||
* Return an async iterator for walking glob pattern matches.
|
||||
*/
|
||||
export declare function globIterate(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): AsyncGenerator<string, void, void>;
|
||||
export declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): AsyncGenerator<Path, void, void>;
|
||||
export declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): AsyncGenerator<string, void, void>;
|
||||
export declare function globIterate(pattern: string | string[], options: GlobOptions): AsyncGenerator<Path, void, void> | AsyncGenerator<string, void, void>;
|
||||
export declare const streamSync: typeof globStreamSync;
|
||||
export declare const stream: typeof globStream & {
|
||||
sync: typeof globStreamSync;
|
||||
};
|
||||
export declare const iterateSync: typeof globIterateSync;
|
||||
export declare const iterate: typeof globIterate & {
|
||||
sync: typeof globIterateSync;
|
||||
};
|
||||
export declare const sync: typeof globSync & {
|
||||
stream: typeof globStreamSync;
|
||||
iterate: typeof globIterateSync;
|
||||
};
|
||||
export { escape, unescape } from 'minimatch';
|
||||
export { Glob } from './glob.js';
|
||||
export type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset, } from './glob.js';
|
||||
export { hasMagic } from './has-magic.js';
|
||||
export type { IgnoreLike } from './ignore.js';
|
||||
export type { MatchStream } from './walker.js';
|
||||
declare const _default: typeof glob & {
|
||||
glob: typeof glob;
|
||||
globSync: typeof globSync;
|
||||
sync: typeof globSync & {
|
||||
stream: typeof globStreamSync;
|
||||
iterate: typeof globIterateSync;
|
||||
};
|
||||
globStream: typeof globStream;
|
||||
stream: typeof globStream & {
|
||||
sync: typeof globStreamSync;
|
||||
};
|
||||
globStreamSync: typeof globStreamSync;
|
||||
streamSync: typeof globStreamSync;
|
||||
globIterate: typeof globIterate;
|
||||
iterate: typeof globIterate & {
|
||||
sync: typeof globIterateSync;
|
||||
};
|
||||
globIterateSync: typeof globIterateSync;
|
||||
iterateSync: typeof globIterateSync;
|
||||
Glob: typeof Glob;
|
||||
hasMagic: (pattern: string | string[], options?: GlobOptions) => boolean;
|
||||
escape: (s: string, { windowsPathsNoEscape, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape"> | undefined) => string;
|
||||
unescape: (s: string, { windowsPathsNoEscape, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape"> | undefined) => string;
|
||||
};
|
||||
export default _default;
|
||||
//# sourceMappingURL=index.d.ts.map
|
1
@capacitor/cli/node_modules/glob/dist/mjs/index.d.ts.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/mjs/index.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,EACV,WAAW,EACX,6BAA6B,EAC7B,4BAA4B,EAC5B,6BAA6B,EAC9B,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,EAAE,4BAA4B,GACpC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AACvB,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,EAAE,6BAA6B,GACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAC3B,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,EAAE,6BAA6B,GACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,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E,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAG9C,wBAgBE"}
|
55
@capacitor/cli/node_modules/glob/dist/mjs/index.js
generated
vendored
Normal file
55
@capacitor/cli/node_modules/glob/dist/mjs/index.js
generated
vendored
Normal file
|
@ -0,0 +1,55 @@
|
|||
import { escape, unescape } from 'minimatch';
|
||||
import { Glob } from './glob.js';
|
||||
import { hasMagic } from './has-magic.js';
|
||||
export function globStreamSync(pattern, options = {}) {
|
||||
return new Glob(pattern, options).streamSync();
|
||||
}
|
||||
export function globStream(pattern, options = {}) {
|
||||
return new Glob(pattern, options).stream();
|
||||
}
|
||||
export function globSync(pattern, options = {}) {
|
||||
return new Glob(pattern, options).walkSync();
|
||||
}
|
||||
export async function glob(pattern, options = {}) {
|
||||
return new Glob(pattern, options).walk();
|
||||
}
|
||||
export function globIterateSync(pattern, options = {}) {
|
||||
return new Glob(pattern, options).iterateSync();
|
||||
}
|
||||
export function globIterate(pattern, options = {}) {
|
||||
return new Glob(pattern, options).iterate();
|
||||
}
|
||||
// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc
|
||||
export const streamSync = globStreamSync;
|
||||
export const stream = Object.assign(globStream, { sync: globStreamSync });
|
||||
export const iterateSync = globIterateSync;
|
||||
export const iterate = Object.assign(globIterate, {
|
||||
sync: globIterateSync,
|
||||
});
|
||||
export const sync = Object.assign(globSync, {
|
||||
stream: globStreamSync,
|
||||
iterate: globIterateSync,
|
||||
});
|
||||
/* c8 ignore start */
|
||||
export { escape, unescape } from 'minimatch';
|
||||
export { Glob } from './glob.js';
|
||||
export { hasMagic } from './has-magic.js';
|
||||
/* c8 ignore stop */
|
||||
export default Object.assign(glob, {
|
||||
glob,
|
||||
globSync,
|
||||
sync,
|
||||
globStream,
|
||||
stream,
|
||||
globStreamSync,
|
||||
streamSync,
|
||||
globIterate,
|
||||
iterate,
|
||||
globIterateSync,
|
||||
iterateSync,
|
||||
Glob,
|
||||
hasMagic,
|
||||
escape,
|
||||
unescape,
|
||||
});
|
||||
//# sourceMappingURL=index.js.map
|
1
@capacitor/cli/node_modules/glob/dist/mjs/index.js.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/mjs/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
@capacitor/cli/node_modules/glob/dist/mjs/package.json
generated
vendored
Normal file
3
@capacitor/cli/node_modules/glob/dist/mjs/package.json
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"type": "module"
|
||||
}
|
77
@capacitor/cli/node_modules/glob/dist/mjs/pattern.d.ts
generated
vendored
Normal file
77
@capacitor/cli/node_modules/glob/dist/mjs/pattern.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,77 @@
|
|||
/// <reference types="node" />
|
||||
import { GLOBSTAR } from 'minimatch';
|
||||
export type MMPattern = string | RegExp | typeof GLOBSTAR;
|
||||
export type PatternList = [p: MMPattern, ...rest: MMPattern[]];
|
||||
export type UNCPatternList = [
|
||||
p0: '',
|
||||
p1: '',
|
||||
p2: string,
|
||||
p3: string,
|
||||
...rest: MMPattern[]
|
||||
];
|
||||
export type DrivePatternList = [p0: string, ...rest: MMPattern[]];
|
||||
export type AbsolutePatternList = [p0: '', ...rest: MMPattern[]];
|
||||
export type GlobList = [p: string, ...rest: string[]];
|
||||
/**
|
||||
* An immutable-ish view on an array of glob parts and their parsed
|
||||
* results
|
||||
*/
|
||||
export declare class Pattern {
|
||||
#private;
|
||||
readonly length: number;
|
||||
constructor(patternList: MMPattern[], globList: string[], index: number, platform: NodeJS.Platform);
|
||||
/**
|
||||
* The first entry in the parsed list of patterns
|
||||
*/
|
||||
pattern(): MMPattern;
|
||||
/**
|
||||
* true of if pattern() returns a string
|
||||
*/
|
||||
isString(): boolean;
|
||||
/**
|
||||
* true of if pattern() returns GLOBSTAR
|
||||
*/
|
||||
isGlobstar(): boolean;
|
||||
/**
|
||||
* true if pattern() returns a regexp
|
||||
*/
|
||||
isRegExp(): boolean;
|
||||
/**
|
||||
* The /-joined set of glob parts that make up this pattern
|
||||
*/
|
||||
globString(): string;
|
||||
/**
|
||||
* true if there are more pattern parts after this one
|
||||
*/
|
||||
hasMore(): boolean;
|
||||
/**
|
||||
* The rest of the pattern after this part, or null if this is the end
|
||||
*/
|
||||
rest(): Pattern | null;
|
||||
/**
|
||||
* true if the pattern represents a //unc/path/ on windows
|
||||
*/
|
||||
isUNC(): boolean;
|
||||
/**
|
||||
* True if the pattern starts with a drive letter on Windows
|
||||
*/
|
||||
isDrive(): boolean;
|
||||
/**
|
||||
* True if the pattern is rooted on an absolute path
|
||||
*/
|
||||
isAbsolute(): boolean;
|
||||
/**
|
||||
* consume the root of the pattern, and return it
|
||||
*/
|
||||
root(): string;
|
||||
/**
|
||||
* Check to see if the current globstar pattern is allowed to follow
|
||||
* a symbolic link.
|
||||
*/
|
||||
checkFollowGlobstar(): boolean;
|
||||
/**
|
||||
* Mark that the current globstar pattern is following a symbolic link
|
||||
*/
|
||||
markFollowGlobstar(): boolean;
|
||||
}
|
||||
//# sourceMappingURL=pattern.d.ts.map
|
1
@capacitor/cli/node_modules/glob/dist/mjs/pattern.d.ts.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/mjs/pattern.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"pattern.d.ts","sourceRoot":"","sources":["../../src/pattern.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,QAAQ,CAAA;AAGzD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;AAC9D,MAA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generated
vendored
Normal file
215
@capacitor/cli/node_modules/glob/dist/mjs/pattern.js
generated
vendored
Normal file
|
@ -0,0 +1,215 @@
|
|||
// this is just a very light wrapper around 2 arrays with an offset index
|
||||
import { GLOBSTAR } from 'minimatch';
|
||||
const isPatternList = (pl) => pl.length >= 1;
|
||||
const isGlobList = (gl) => gl.length >= 1;
|
||||
/**
|
||||
* An immutable-ish view on an array of glob parts and their parsed
|
||||
* results
|
||||
*/
|
||||
export class Pattern {
|
||||
#patternList;
|
||||
#globList;
|
||||
#index;
|
||||
length;
|
||||
#platform;
|
||||
#rest;
|
||||
#globString;
|
||||
#isDrive;
|
||||
#isUNC;
|
||||
#isAbsolute;
|
||||
#followGlobstar = true;
|
||||
constructor(patternList, globList, index, platform) {
|
||||
if (!isPatternList(patternList)) {
|
||||
throw new TypeError('empty pattern list');
|
||||
}
|
||||
if (!isGlobList(globList)) {
|
||||
throw new TypeError('empty glob list');
|
||||
}
|
||||
if (globList.length !== patternList.length) {
|
||||
throw new TypeError('mismatched pattern list and glob list lengths');
|
||||
}
|
||||
this.length = patternList.length;
|
||||
if (index < 0 || index >= this.length) {
|
||||
throw new TypeError('index out of range');
|
||||
}
|
||||
this.#patternList = patternList;
|
||||
this.#globList = globList;
|
||||
this.#index = index;
|
||||
this.#platform = platform;
|
||||
// normalize root entries of absolute patterns on initial creation.
|
||||
if (this.#index === 0) {
|
||||
// c: => ['c:/']
|
||||
// C:/ => ['C:/']
|
||||
// C:/x => ['C:/', 'x']
|
||||
// //host/share => ['//host/share/']
|
||||
// //host/share/ => ['//host/share/']
|
||||
// //host/share/x => ['//host/share/', 'x']
|
||||
// /etc => ['/', 'etc']
|
||||
// / => ['/']
|
||||
if (this.isUNC()) {
|
||||
// '' / '' / 'host' / 'share'
|
||||
const [p0, p1, p2, p3, ...prest] = this.#patternList;
|
||||
const [g0, g1, g2, g3, ...grest] = this.#globList;
|
||||
if (prest[0] === '') {
|
||||
// ends in /
|
||||
prest.shift();
|
||||
grest.shift();
|
||||
}
|
||||
const p = [p0, p1, p2, p3, ''].join('/');
|
||||
const g = [g0, g1, g2, g3, ''].join('/');
|
||||
this.#patternList = [p, ...prest];
|
||||
this.#globList = [g, ...grest];
|
||||
this.length = this.#patternList.length;
|
||||
}
|
||||
else if (this.isDrive() || this.isAbsolute()) {
|
||||
const [p1, ...prest] = this.#patternList;
|
||||
const [g1, ...grest] = this.#globList;
|
||||
if (prest[0] === '') {
|
||||
// ends in /
|
||||
prest.shift();
|
||||
grest.shift();
|
||||
}
|
||||
const p = p1 + '/';
|
||||
const g = g1 + '/';
|
||||
this.#patternList = [p, ...prest];
|
||||
this.#globList = [g, ...grest];
|
||||
this.length = this.#patternList.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The first entry in the parsed list of patterns
|
||||
*/
|
||||
pattern() {
|
||||
return this.#patternList[this.#index];
|
||||
}
|
||||
/**
|
||||
* true of if pattern() returns a string
|
||||
*/
|
||||
isString() {
|
||||
return typeof this.#patternList[this.#index] === 'string';
|
||||
}
|
||||
/**
|
||||
* true of if pattern() returns GLOBSTAR
|
||||
*/
|
||||
isGlobstar() {
|
||||
return this.#patternList[this.#index] === GLOBSTAR;
|
||||
}
|
||||
/**
|
||||
* true if pattern() returns a regexp
|
||||
*/
|
||||
isRegExp() {
|
||||
return this.#patternList[this.#index] instanceof RegExp;
|
||||
}
|
||||
/**
|
||||
* The /-joined set of glob parts that make up this pattern
|
||||
*/
|
||||
globString() {
|
||||
return (this.#globString =
|
||||
this.#globString ||
|
||||
(this.#index === 0
|
||||
? this.isAbsolute()
|
||||
? this.#globList[0] + this.#globList.slice(1).join('/')
|
||||
: this.#globList.join('/')
|
||||
: this.#globList.slice(this.#index).join('/')));
|
||||
}
|
||||
/**
|
||||
* true if there are more pattern parts after this one
|
||||
*/
|
||||
hasMore() {
|
||||
return this.length > this.#index + 1;
|
||||
}
|
||||
/**
|
||||
* The rest of the pattern after this part, or null if this is the end
|
||||
*/
|
||||
rest() {
|
||||
if (this.#rest !== undefined)
|
||||
return this.#rest;
|
||||
if (!this.hasMore())
|
||||
return (this.#rest = null);
|
||||
this.#rest = new Pattern(this.#patternList, this.#globList, this.#index + 1, this.#platform);
|
||||
this.#rest.#isAbsolute = this.#isAbsolute;
|
||||
this.#rest.#isUNC = this.#isUNC;
|
||||
this.#rest.#isDrive = this.#isDrive;
|
||||
return this.#rest;
|
||||
}
|
||||
/**
|
||||
* true if the pattern represents a //unc/path/ on windows
|
||||
*/
|
||||
isUNC() {
|
||||
const pl = this.#patternList;
|
||||
return this.#isUNC !== undefined
|
||||
? this.#isUNC
|
||||
: (this.#isUNC =
|
||||
this.#platform === 'win32' &&
|
||||
this.#index === 0 &&
|
||||
pl[0] === '' &&
|
||||
pl[1] === '' &&
|
||||
typeof pl[2] === 'string' &&
|
||||
!!pl[2] &&
|
||||
typeof pl[3] === 'string' &&
|
||||
!!pl[3]);
|
||||
}
|
||||
// pattern like C:/...
|
||||
// split = ['C:', ...]
|
||||
// XXX: would be nice to handle patterns like `c:*` to test the cwd
|
||||
// in c: for *, but I don't know of a way to even figure out what that
|
||||
// cwd is without actually chdir'ing into it?
|
||||
/**
|
||||
* True if the pattern starts with a drive letter on Windows
|
||||
*/
|
||||
isDrive() {
|
||||
const pl = this.#patternList;
|
||||
return this.#isDrive !== undefined
|
||||
? this.#isDrive
|
||||
: (this.#isDrive =
|
||||
this.#platform === 'win32' &&
|
||||
this.#index === 0 &&
|
||||
this.length > 1 &&
|
||||
typeof pl[0] === 'string' &&
|
||||
/^[a-z]:$/i.test(pl[0]));
|
||||
}
|
||||
// pattern = '/' or '/...' or '/x/...'
|
||||
// split = ['', ''] or ['', ...] or ['', 'x', ...]
|
||||
// Drive and UNC both considered absolute on windows
|
||||
/**
|
||||
* True if the pattern is rooted on an absolute path
|
||||
*/
|
||||
isAbsolute() {
|
||||
const pl = this.#patternList;
|
||||
return this.#isAbsolute !== undefined
|
||||
? this.#isAbsolute
|
||||
: (this.#isAbsolute =
|
||||
(pl[0] === '' && pl.length > 1) ||
|
||||
this.isDrive() ||
|
||||
this.isUNC());
|
||||
}
|
||||
/**
|
||||
* consume the root of the pattern, and return it
|
||||
*/
|
||||
root() {
|
||||
const p = this.#patternList[0];
|
||||
return typeof p === 'string' && this.isAbsolute() && this.#index === 0
|
||||
? p
|
||||
: '';
|
||||
}
|
||||
/**
|
||||
* Check to see if the current globstar pattern is allowed to follow
|
||||
* a symbolic link.
|
||||
*/
|
||||
checkFollowGlobstar() {
|
||||
return !(this.#index === 0 ||
|
||||
!this.isGlobstar() ||
|
||||
!this.#followGlobstar);
|
||||
}
|
||||
/**
|
||||
* Mark that the current globstar pattern is following a symbolic link
|
||||
*/
|
||||
markFollowGlobstar() {
|
||||
if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)
|
||||
return false;
|
||||
this.#followGlobstar = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=pattern.js.map
|
1
@capacitor/cli/node_modules/glob/dist/mjs/pattern.js.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/mjs/pattern.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
59
@capacitor/cli/node_modules/glob/dist/mjs/processor.d.ts
generated
vendored
Normal file
59
@capacitor/cli/node_modules/glob/dist/mjs/processor.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,59 @@
|
|||
import { MMRegExp } from 'minimatch';
|
||||
import { Path } from 'path-scurry';
|
||||
import { Pattern } from './pattern.js';
|
||||
import { GlobWalkerOpts } from './walker.js';
|
||||
/**
|
||||
* A cache of which patterns have been processed for a given Path
|
||||
*/
|
||||
export declare class HasWalkedCache {
|
||||
store: Map<string, Set<string>>;
|
||||
constructor(store?: Map<string, Set<string>>);
|
||||
copy(): HasWalkedCache;
|
||||
hasWalked(target: Path, pattern: Pattern): boolean | undefined;
|
||||
storeWalked(target: Path, pattern: Pattern): void;
|
||||
}
|
||||
/**
|
||||
* A record of which paths have been matched in a given walk step,
|
||||
* and whether they only are considered a match if they are a directory,
|
||||
* and whether their absolute or relative path should be returned.
|
||||
*/
|
||||
export declare class MatchRecord {
|
||||
store: Map<Path, number>;
|
||||
add(target: Path, absolute: boolean, ifDir: boolean): void;
|
||||
entries(): [Path, boolean, boolean][];
|
||||
}
|
||||
/**
|
||||
* A collection of patterns that must be processed in a subsequent step
|
||||
* for a given path.
|
||||
*/
|
||||
export declare class SubWalks {
|
||||
store: Map<Path, Pattern[]>;
|
||||
add(target: Path, pattern: Pattern): void;
|
||||
get(target: Path): Pattern[];
|
||||
entries(): [Path, Pattern[]][];
|
||||
keys(): Path[];
|
||||
}
|
||||
/**
|
||||
* The class that processes patterns for a given path.
|
||||
*
|
||||
* Handles child entry filtering, and determining whether a path's
|
||||
* directory contents must be read.
|
||||
*/
|
||||
export declare class Processor {
|
||||
hasWalkedCache: HasWalkedCache;
|
||||
matches: MatchRecord;
|
||||
subwalks: SubWalks;
|
||||
patterns?: Pattern[];
|
||||
follow: boolean;
|
||||
dot: boolean;
|
||||
opts: GlobWalkerOpts;
|
||||
constructor(opts: GlobWalkerOpts, hasWalkedCache?: HasWalkedCache);
|
||||
processPatterns(target: Path, patterns: Pattern[]): this;
|
||||
subwalkTargets(): Path[];
|
||||
child(): Processor;
|
||||
filterEntries(parent: Path, entries: Path[]): Processor;
|
||||
testGlobstar(e: Path, pattern: Pattern, rest: Pattern | null, absolute: boolean): void;
|
||||
testRegExp(e: Path, p: MMRegExp, rest: Pattern | null, absolute: boolean): void;
|
||||
testString(e: Path, p: string, rest: Pattern | null, absolute: boolean): void;
|
||||
}
|
||||
//# sourceMappingURL=processor.d.ts.map
|
1
@capacitor/cli/node_modules/glob/dist/mjs/processor.d.ts.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/mjs/processor.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../src/processor.ts"],"names":[],"mappings":"AAEA,OAAO,EAA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,EAAE,OAAO,CAAA;IACf,GAAG,EAAE,OAAO,CAAA;IACZ,IAAI,EAAE,cAAc,CAAA;gBAER,IAAI,EAAE,cAAc,EAAE,cAAc,CAAC,EAAE,cAAc;IASjE,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE;IAwGjD,cAAc,IAAI,IAAI,EAAE;IAIxB,KAAK;IAQL,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,SAAS;IAqBvD,YAAY,CACV,CAAC,EAAE,IAAI,EACP,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,OAAO,GAAG,IAAI,EACpB,QAAQ,EAAE,OAAO;IA8CnB,UAAU,CACR,CAAC,EAAE,IAAI,EACP,CAAC,EAAE,QAAQ,EACX,IAAI,EAAE,OAAO,GAAG,IAAI,EACpB,QAAQ,EAAE,OAAO;IAUnB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,EAAE,QAAQ,EAAE,OAAO;CASvE"}
|
302
@capacitor/cli/node_modules/glob/dist/mjs/processor.js
generated
vendored
Normal file
302
@capacitor/cli/node_modules/glob/dist/mjs/processor.js
generated
vendored
Normal file
|
@ -0,0 +1,302 @@
|
|||
// synchronous utility for filtering entries and calculating subwalks
|
||||
import { GLOBSTAR } from 'minimatch';
|
||||
/**
|
||||
* A cache of which patterns have been processed for a given Path
|
||||
*/
|
||||
export class HasWalkedCache {
|
||||
store;
|
||||
constructor(store = new Map()) {
|
||||
this.store = store;
|
||||
}
|
||||
copy() {
|
||||
return new HasWalkedCache(new Map(this.store));
|
||||
}
|
||||
hasWalked(target, pattern) {
|
||||
return this.store.get(target.fullpath())?.has(pattern.globString());
|
||||
}
|
||||
storeWalked(target, pattern) {
|
||||
const fullpath = target.fullpath();
|
||||
const cached = this.store.get(fullpath);
|
||||
if (cached)
|
||||
cached.add(pattern.globString());
|
||||
else
|
||||
this.store.set(fullpath, new Set([pattern.globString()]));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* A record of which paths have been matched in a given walk step,
|
||||
* and whether they only are considered a match if they are a directory,
|
||||
* and whether their absolute or relative path should be returned.
|
||||
*/
|
||||
export class MatchRecord {
|
||||
store = new Map();
|
||||
add(target, absolute, ifDir) {
|
||||
const n = (absolute ? 2 : 0) | (ifDir ? 1 : 0);
|
||||
const current = this.store.get(target);
|
||||
this.store.set(target, current === undefined ? n : n & current);
|
||||
}
|
||||
// match, absolute, ifdir
|
||||
entries() {
|
||||
return [...this.store.entries()].map(([path, n]) => [
|
||||
path,
|
||||
!!(n & 2),
|
||||
!!(n & 1),
|
||||
]);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* A collection of patterns that must be processed in a subsequent step
|
||||
* for a given path.
|
||||
*/
|
||||
export class SubWalks {
|
||||
store = new Map();
|
||||
add(target, pattern) {
|
||||
if (!target.canReaddir()) {
|
||||
return;
|
||||
}
|
||||
const subs = this.store.get(target);
|
||||
if (subs) {
|
||||
if (!subs.find(p => p.globString() === pattern.globString())) {
|
||||
subs.push(pattern);
|
||||
}
|
||||
}
|
||||
else
|
||||
this.store.set(target, [pattern]);
|
||||
}
|
||||
get(target) {
|
||||
const subs = this.store.get(target);
|
||||
/* c8 ignore start */
|
||||
if (!subs) {
|
||||
throw new Error('attempting to walk unknown path');
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
return subs;
|
||||
}
|
||||
entries() {
|
||||
return this.keys().map(k => [k, this.store.get(k)]);
|
||||
}
|
||||
keys() {
|
||||
return [...this.store.keys()].filter(t => t.canReaddir());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The class that processes patterns for a given path.
|
||||
*
|
||||
* Handles child entry filtering, and determining whether a path's
|
||||
* directory contents must be read.
|
||||
*/
|
||||
export class Processor {
|
||||
hasWalkedCache;
|
||||
matches = new MatchRecord();
|
||||
subwalks = new SubWalks();
|
||||
patterns;
|
||||
follow;
|
||||
dot;
|
||||
opts;
|
||||
constructor(opts, hasWalkedCache) {
|
||||
this.opts = opts;
|
||||
this.follow = !!opts.follow;
|
||||
this.dot = !!opts.dot;
|
||||
this.hasWalkedCache = hasWalkedCache
|
||||
? hasWalkedCache.copy()
|
||||
: new HasWalkedCache();
|
||||
}
|
||||
processPatterns(target, patterns) {
|
||||
this.patterns = patterns;
|
||||
const processingSet = patterns.map(p => [target, p]);
|
||||
// map of paths to the magic-starting subwalks they need to walk
|
||||
// first item in patterns is the filter
|
||||
for (let [t, pattern] of processingSet) {
|
||||
this.hasWalkedCache.storeWalked(t, pattern);
|
||||
const root = pattern.root();
|
||||
const absolute = pattern.isAbsolute() && this.opts.absolute !== false;
|
||||
// start absolute patterns at root
|
||||
if (root) {
|
||||
t = t.resolve(root === '/' && this.opts.root !== undefined
|
||||
? this.opts.root
|
||||
: root);
|
||||
const rest = pattern.rest();
|
||||
if (!rest) {
|
||||
this.matches.add(t, true, false);
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
pattern = rest;
|
||||
}
|
||||
}
|
||||
if (t.isENOENT())
|
||||
continue;
|
||||
let p;
|
||||
let rest;
|
||||
let changed = false;
|
||||
while (typeof (p = pattern.pattern()) === 'string' &&
|
||||
(rest = pattern.rest())) {
|
||||
const c = t.resolve(p);
|
||||
// we can be reasonably sure that .. is a readable dir
|
||||
if (c.isUnknown() && p !== '..')
|
||||
break;
|
||||
t = c;
|
||||
pattern = rest;
|
||||
changed = true;
|
||||
}
|
||||
p = pattern.pattern();
|
||||
rest = pattern.rest();
|
||||
if (changed) {
|
||||
if (this.hasWalkedCache.hasWalked(t, pattern))
|
||||
continue;
|
||||
this.hasWalkedCache.storeWalked(t, pattern);
|
||||
}
|
||||
// now we have either a final string for a known entry,
|
||||
// more strings for an unknown entry,
|
||||
// or a pattern starting with magic, mounted on t.
|
||||
if (typeof p === 'string') {
|
||||
// must be final entry
|
||||
if (!rest) {
|
||||
const ifDir = p === '..' || p === '' || p === '.';
|
||||
this.matches.add(t.resolve(p), absolute, ifDir);
|
||||
}
|
||||
else {
|
||||
this.subwalks.add(t, pattern);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else if (p === GLOBSTAR) {
|
||||
// if no rest, match and subwalk pattern
|
||||
// if rest, process rest and subwalk pattern
|
||||
// if it's a symlink, but we didn't get here by way of a
|
||||
// globstar match (meaning it's the first time THIS globstar
|
||||
// has traversed a symlink), then we follow it. Otherwise, stop.
|
||||
if (!t.isSymbolicLink() ||
|
||||
this.follow ||
|
||||
pattern.checkFollowGlobstar()) {
|
||||
this.subwalks.add(t, pattern);
|
||||
}
|
||||
const rp = rest?.pattern();
|
||||
const rrest = rest?.rest();
|
||||
if (!rest || ((rp === '' || rp === '.') && !rrest)) {
|
||||
// only HAS to be a dir if it ends in **/ or **/.
|
||||
// but ending in ** will match files as well.
|
||||
this.matches.add(t, absolute, rp === '' || rp === '.');
|
||||
}
|
||||
else {
|
||||
if (rp === '..') {
|
||||
// this would mean you're matching **/.. at the fs root,
|
||||
// and no thanks, I'm not gonna test that specific case.
|
||||
/* c8 ignore start */
|
||||
const tp = t.parent || t;
|
||||
/* c8 ignore stop */
|
||||
if (!rrest)
|
||||
this.matches.add(tp, absolute, true);
|
||||
else if (!this.hasWalkedCache.hasWalked(tp, rrest)) {
|
||||
this.subwalks.add(tp, rrest);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (p instanceof RegExp) {
|
||||
this.subwalks.add(t, pattern);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
subwalkTargets() {
|
||||
return this.subwalks.keys();
|
||||
}
|
||||
child() {
|
||||
return new Processor(this.opts, this.hasWalkedCache);
|
||||
}
|
||||
// return a new Processor containing the subwalks for each
|
||||
// child entry, and a set of matches, and
|
||||
// a hasWalkedCache that's a copy of this one
|
||||
// then we're going to call
|
||||
filterEntries(parent, entries) {
|
||||
const patterns = this.subwalks.get(parent);
|
||||
// put matches and entry walks into the results processor
|
||||
const results = this.child();
|
||||
for (const e of entries) {
|
||||
for (const pattern of patterns) {
|
||||
const absolute = pattern.isAbsolute();
|
||||
const p = pattern.pattern();
|
||||
const rest = pattern.rest();
|
||||
if (p === GLOBSTAR) {
|
||||
results.testGlobstar(e, pattern, rest, absolute);
|
||||
}
|
||||
else if (p instanceof RegExp) {
|
||||
results.testRegExp(e, p, rest, absolute);
|
||||
}
|
||||
else {
|
||||
results.testString(e, p, rest, absolute);
|
||||
}
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
testGlobstar(e, pattern, rest, absolute) {
|
||||
if (this.dot || !e.name.startsWith('.')) {
|
||||
if (!pattern.hasMore()) {
|
||||
this.matches.add(e, absolute, false);
|
||||
}
|
||||
if (e.canReaddir()) {
|
||||
// if we're in follow mode or it's not a symlink, just keep
|
||||
// testing the same pattern. If there's more after the globstar,
|
||||
// then this symlink consumes the globstar. If not, then we can
|
||||
// follow at most ONE symlink along the way, so we mark it, which
|
||||
// also checks to ensure that it wasn't already marked.
|
||||
if (this.follow || !e.isSymbolicLink()) {
|
||||
this.subwalks.add(e, pattern);
|
||||
}
|
||||
else if (e.isSymbolicLink()) {
|
||||
if (rest && pattern.checkFollowGlobstar()) {
|
||||
this.subwalks.add(e, rest);
|
||||
}
|
||||
else if (pattern.markFollowGlobstar()) {
|
||||
this.subwalks.add(e, pattern);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// if the NEXT thing matches this entry, then also add
|
||||
// the rest.
|
||||
if (rest) {
|
||||
const rp = rest.pattern();
|
||||
if (typeof rp === 'string' &&
|
||||
// dots and empty were handled already
|
||||
rp !== '..' &&
|
||||
rp !== '' &&
|
||||
rp !== '.') {
|
||||
this.testString(e, rp, rest.rest(), absolute);
|
||||
}
|
||||
else if (rp === '..') {
|
||||
/* c8 ignore start */
|
||||
const ep = e.parent || e;
|
||||
/* c8 ignore stop */
|
||||
this.subwalks.add(ep, rest);
|
||||
}
|
||||
else if (rp instanceof RegExp) {
|
||||
this.testRegExp(e, rp, rest.rest(), absolute);
|
||||
}
|
||||
}
|
||||
}
|
||||
testRegExp(e, p, rest, absolute) {
|
||||
if (!p.test(e.name))
|
||||
return;
|
||||
if (!rest) {
|
||||
this.matches.add(e, absolute, false);
|
||||
}
|
||||
else {
|
||||
this.subwalks.add(e, rest);
|
||||
}
|
||||
}
|
||||
testString(e, p, rest, absolute) {
|
||||
// should never happen?
|
||||
if (!e.isNamed(p))
|
||||
return;
|
||||
if (!rest) {
|
||||
this.matches.add(e, absolute, false);
|
||||
}
|
||||
else {
|
||||
this.subwalks.add(e, rest);
|
||||
}
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=processor.js.map
|
1
@capacitor/cli/node_modules/glob/dist/mjs/processor.js.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/mjs/processor.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
95
@capacitor/cli/node_modules/glob/dist/mjs/walker.d.ts
generated
vendored
Normal file
95
@capacitor/cli/node_modules/glob/dist/mjs/walker.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,95 @@
|
|||
/// <reference types="node" />
|
||||
/**
|
||||
* Single-use utility classes to provide functionality to the {@link Glob}
|
||||
* methods.
|
||||
*
|
||||
* @module
|
||||
*/
|
||||
import Minipass from 'minipass';
|
||||
import { Path } from 'path-scurry';
|
||||
import { IgnoreLike } from './ignore.js';
|
||||
import { Pattern } from './pattern.js';
|
||||
import { Processor } from './processor.js';
|
||||
export interface GlobWalkerOpts {
|
||||
absolute?: boolean;
|
||||
allowWindowsEscape?: boolean;
|
||||
cwd?: string | URL;
|
||||
dot?: boolean;
|
||||
dotRelative?: boolean;
|
||||
follow?: boolean;
|
||||
ignore?: string | string[] | IgnoreLike;
|
||||
mark?: boolean;
|
||||
matchBase?: boolean;
|
||||
maxDepth?: number;
|
||||
nobrace?: boolean;
|
||||
nocase?: boolean;
|
||||
nodir?: boolean;
|
||||
noext?: boolean;
|
||||
noglobstar?: boolean;
|
||||
platform?: NodeJS.Platform;
|
||||
realpath?: boolean;
|
||||
root?: string;
|
||||
stat?: boolean;
|
||||
signal?: AbortSignal;
|
||||
windowsPathsNoEscape?: boolean;
|
||||
withFileTypes?: boolean;
|
||||
}
|
||||
export type GWOFileTypesTrue = GlobWalkerOpts & {
|
||||
withFileTypes: true;
|
||||
};
|
||||
export type GWOFileTypesFalse = GlobWalkerOpts & {
|
||||
withFileTypes: false;
|
||||
};
|
||||
export type GWOFileTypesUnset = GlobWalkerOpts & {
|
||||
withFileTypes?: undefined;
|
||||
};
|
||||
export type Result<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Path : O extends GWOFileTypesFalse ? string : O extends GWOFileTypesUnset ? string : Path | string;
|
||||
export type Matches<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Set<Path> : O extends GWOFileTypesFalse ? Set<string> : O extends GWOFileTypesUnset ? Set<string> : Set<Path | string>;
|
||||
export type MatchStream<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Minipass<Path, Path> : O extends GWOFileTypesFalse ? Minipass<string, string> : O extends GWOFileTypesUnset ? Minipass<string, string> : Minipass<Path | string, Path | string>;
|
||||
/**
|
||||
* basic walking utilities that all the glob walker types use
|
||||
*/
|
||||
export declare abstract class GlobUtil<O extends GlobWalkerOpts = GlobWalkerOpts> {
|
||||
#private;
|
||||
path: Path;
|
||||
patterns: Pattern[];
|
||||
opts: O;
|
||||
seen: Set<Path>;
|
||||
paused: boolean;
|
||||
aborted: boolean;
|
||||
signal?: AbortSignal;
|
||||
maxDepth: number;
|
||||
constructor(patterns: Pattern[], path: Path, opts: O);
|
||||
pause(): void;
|
||||
resume(): void;
|
||||
onResume(fn: () => any): void;
|
||||
matchCheck(e: Path, ifDir: boolean): Promise<Path | undefined>;
|
||||
matchCheckTest(e: Path | undefined, ifDir: boolean): Path | undefined;
|
||||
matchCheckSync(e: Path, ifDir: boolean): Path | undefined;
|
||||
abstract matchEmit(p: Result<O>): void;
|
||||
abstract matchEmit(p: string | Path): void;
|
||||
matchFinish(e: Path, absolute: boolean): void;
|
||||
match(e: Path, absolute: boolean, ifDir: boolean): Promise<void>;
|
||||
matchSync(e: Path, absolute: boolean, ifDir: boolean): void;
|
||||
walkCB(target: Path, patterns: Pattern[], cb: () => any): void;
|
||||
walkCB2(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any;
|
||||
walkCB3(target: Path, entries: Path[], processor: Processor, cb: () => any): void;
|
||||
walkCBSync(target: Path, patterns: Pattern[], cb: () => any): void;
|
||||
walkCB2Sync(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any;
|
||||
walkCB3Sync(target: Path, entries: Path[], processor: Processor, cb: () => any): void;
|
||||
}
|
||||
export declare class GlobWalker<O extends GlobWalkerOpts = GlobWalkerOpts> extends GlobUtil<O> {
|
||||
matches: O extends GWOFileTypesTrue ? Set<Path> : O extends GWOFileTypesFalse ? Set<string> : O extends GWOFileTypesUnset ? Set<string> : Set<Path | string>;
|
||||
constructor(patterns: Pattern[], path: Path, opts: O);
|
||||
matchEmit(e: Result<O>): void;
|
||||
walk(): Promise<Matches<O>>;
|
||||
walkSync(): Matches<O>;
|
||||
}
|
||||
export declare class GlobStream<O extends GlobWalkerOpts = GlobWalkerOpts> extends GlobUtil<O> {
|
||||
results: O extends GWOFileTypesTrue ? Minipass<Path, Path> : O extends GWOFileTypesFalse ? Minipass<string, string> : O extends GWOFileTypesUnset ? Minipass<string, string> : Minipass<Path | string, Path | string>;
|
||||
constructor(patterns: Pattern[], path: Path, opts: O);
|
||||
matchEmit(e: Result<O>): void;
|
||||
stream(): MatchStream<O>;
|
||||
streamSync(): MatchStream<O>;
|
||||
}
|
||||
//# sourceMappingURL=walker.d.ts.map
|
1
@capacitor/cli/node_modules/glob/dist/mjs/walker.d.ts.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/mjs/walker.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"walker.d.ts","sourceRo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,GAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,GACxB,CAAC,SAAS,iBAAiB,GAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,GACxB,QAAQ,CAAC,IAAI,GAAG,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC,CAAA;gBAE9B,QAAQ,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAUpD,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI;IAM7B,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC;IAYxB,UAAU,IAAI,WAAW,CAAC,CAAC,CAAC;CAO7B"}
|
351
@capacitor/cli/node_modules/glob/dist/mjs/walker.js
generated
vendored
Normal file
351
@capacitor/cli/node_modules/glob/dist/mjs/walker.js
generated
vendored
Normal file
|
@ -0,0 +1,351 @@
|
|||
/**
|
||||
* Single-use utility classes to provide functionality to the {@link Glob}
|
||||
* methods.
|
||||
*
|
||||
* @module
|
||||
*/
|
||||
import Minipass from 'minipass';
|
||||
import { Ignore } from './ignore.js';
|
||||
import { Processor } from './processor.js';
|
||||
const makeIgnore = (ignore, opts) => typeof ignore === 'string'
|
||||
? new Ignore([ignore], opts)
|
||||
: Array.isArray(ignore)
|
||||
? new Ignore(ignore, opts)
|
||||
: ignore;
|
||||
/**
|
||||
* basic walking utilities that all the glob walker types use
|
||||
*/
|
||||
export class GlobUtil {
|
||||
path;
|
||||
patterns;
|
||||
opts;
|
||||
seen = new Set();
|
||||
paused = false;
|
||||
aborted = false;
|
||||
#onResume = [];
|
||||
#ignore;
|
||||
#sep;
|
||||
signal;
|
||||
maxDepth;
|
||||
constructor(patterns, path, opts) {
|
||||
this.patterns = patterns;
|
||||
this.path = path;
|
||||
this.opts = opts;
|
||||
this.#sep = opts.platform === 'win32' ? '\\' : '/';
|
||||
if (opts.ignore) {
|
||||
this.#ignore = makeIgnore(opts.ignore, opts);
|
||||
}
|
||||
// ignore, always set with maxDepth, but it's optional on the
|
||||
// GlobOptions type
|
||||
/* c8 ignore start */
|
||||
this.maxDepth = opts.maxDepth || Infinity;
|
||||
/* c8 ignore stop */
|
||||
if (opts.signal) {
|
||||
this.signal = opts.signal;
|
||||
this.signal.addEventListener('abort', () => {
|
||||
this.#onResume.length = 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
#ignored(path) {
|
||||
return this.seen.has(path) || !!this.#ignore?.ignored?.(path);
|
||||
}
|
||||
#childrenIgnored(path) {
|
||||
return !!this.#ignore?.childrenIgnored?.(path);
|
||||
}
|
||||
// backpressure mechanism
|
||||
pause() {
|
||||
this.paused = true;
|
||||
}
|
||||
resume() {
|
||||
/* c8 ignore start */
|
||||
if (this.signal?.aborted)
|
||||
return;
|
||||
/* c8 ignore stop */
|
||||
this.paused = false;
|
||||
let fn = undefined;
|
||||
while (!this.paused && (fn = this.#onResume.shift())) {
|
||||
fn();
|
||||
}
|
||||
}
|
||||
onResume(fn) {
|
||||
if (this.signal?.aborted)
|
||||
return;
|
||||
/* c8 ignore start */
|
||||
if (!this.paused) {
|
||||
fn();
|
||||
}
|
||||
else {
|
||||
/* c8 ignore stop */
|
||||
this.#onResume.push(fn);
|
||||
}
|
||||
}
|
||||
// do the requisite realpath/stat checking, and return the path
|
||||
// to add or undefined to filter it out.
|
||||
async matchCheck(e, ifDir) {
|
||||
if (ifDir && this.opts.nodir)
|
||||
return undefined;
|
||||
let rpc;
|
||||
if (this.opts.realpath) {
|
||||
rpc = e.realpathCached() || (await e.realpath());
|
||||
if (!rpc)
|
||||
return undefined;
|
||||
e = rpc;
|
||||
}
|
||||
const needStat = e.isUnknown() || this.opts.stat;
|
||||
return this.matchCheckTest(needStat ? await e.lstat() : e, ifDir);
|
||||
}
|
||||
matchCheckTest(e, ifDir) {
|
||||
return e &&
|
||||
(this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&
|
||||
(!ifDir || e.canReaddir()) &&
|
||||
(!this.opts.nodir || !e.isDirectory()) &&
|
||||
!this.#ignored(e)
|
||||
? e
|
||||
: undefined;
|
||||
}
|
||||
matchCheckSync(e, ifDir) {
|
||||
if (ifDir && this.opts.nodir)
|
||||
return undefined;
|
||||
let rpc;
|
||||
if (this.opts.realpath) {
|
||||
rpc = e.realpathCached() || e.realpathSync();
|
||||
if (!rpc)
|
||||
return undefined;
|
||||
e = rpc;
|
||||
}
|
||||
const needStat = e.isUnknown() || this.opts.stat;
|
||||
return this.matchCheckTest(needStat ? e.lstatSync() : e, ifDir);
|
||||
}
|
||||
matchFinish(e, absolute) {
|
||||
if (this.#ignored(e))
|
||||
return;
|
||||
const abs = this.opts.absolute === undefined ? absolute : this.opts.absolute;
|
||||
this.seen.add(e);
|
||||
const mark = this.opts.mark && e.isDirectory() ? this.#sep : '';
|
||||
// ok, we have what we need!
|
||||
if (this.opts.withFileTypes) {
|
||||
this.matchEmit(e);
|
||||
}
|
||||
else if (abs) {
|
||||
this.matchEmit(e.fullpath() + mark);
|
||||
}
|
||||
else {
|
||||
const rel = e.relative();
|
||||
const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep)
|
||||
? '.' + this.#sep
|
||||
: '';
|
||||
this.matchEmit(!rel && mark ? '.' + mark : pre + rel + mark);
|
||||
}
|
||||
}
|
||||
async match(e, absolute, ifDir) {
|
||||
const p = await this.matchCheck(e, ifDir);
|
||||
if (p)
|
||||
this.matchFinish(p, absolute);
|
||||
}
|
||||
matchSync(e, absolute, ifDir) {
|
||||
const p = this.matchCheckSync(e, ifDir);
|
||||
if (p)
|
||||
this.matchFinish(p, absolute);
|
||||
}
|
||||
walkCB(target, patterns, cb) {
|
||||
/* c8 ignore start */
|
||||
if (this.signal?.aborted)
|
||||
cb();
|
||||
/* c8 ignore stop */
|
||||
this.walkCB2(target, patterns, new Processor(this.opts), cb);
|
||||
}
|
||||
walkCB2(target, patterns, processor, cb) {
|
||||
if (this.#childrenIgnored(target))
|
||||
return cb();
|
||||
if (this.signal?.aborted)
|
||||
cb();
|
||||
if (this.paused) {
|
||||
this.onResume(() => this.walkCB2(target, patterns, processor, cb));
|
||||
return;
|
||||
}
|
||||
processor.processPatterns(target, patterns);
|
||||
// done processing. all of the above is sync, can be abstracted out.
|
||||
// subwalks is a map of paths to the entry filters they need
|
||||
// matches is a map of paths to [absolute, ifDir] tuples.
|
||||
let tasks = 1;
|
||||
const next = () => {
|
||||
if (--tasks === 0)
|
||||
cb();
|
||||
};
|
||||
for (const [m, absolute, ifDir] of processor.matches.entries()) {
|
||||
if (this.#ignored(m))
|
||||
continue;
|
||||
tasks++;
|
||||
this.match(m, absolute, ifDir).then(() => next());
|
||||
}
|
||||
for (const t of processor.subwalkTargets()) {
|
||||
if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
|
||||
continue;
|
||||
}
|
||||
tasks++;
|
||||
const childrenCached = t.readdirCached();
|
||||
if (t.calledReaddir())
|
||||
this.walkCB3(t, childrenCached, processor, next);
|
||||
else {
|
||||
t.readdirCB((_, entries) => this.walkCB3(t, entries, processor, next), true);
|
||||
}
|
||||
}
|
||||
next();
|
||||
}
|
||||
walkCB3(target, entries, processor, cb) {
|
||||
processor = processor.filterEntries(target, entries);
|
||||
let tasks = 1;
|
||||
const next = () => {
|
||||
if (--tasks === 0)
|
||||
cb();
|
||||
};
|
||||
for (const [m, absolute, ifDir] of processor.matches.entries()) {
|
||||
if (this.#ignored(m))
|
||||
continue;
|
||||
tasks++;
|
||||
this.match(m, absolute, ifDir).then(() => next());
|
||||
}
|
||||
for (const [target, patterns] of processor.subwalks.entries()) {
|
||||
tasks++;
|
||||
this.walkCB2(target, patterns, processor.child(), next);
|
||||
}
|
||||
next();
|
||||
}
|
||||
walkCBSync(target, patterns, cb) {
|
||||
/* c8 ignore start */
|
||||
if (this.signal?.aborted)
|
||||
cb();
|
||||
/* c8 ignore stop */
|
||||
this.walkCB2Sync(target, patterns, new Processor(this.opts), cb);
|
||||
}
|
||||
walkCB2Sync(target, patterns, processor, cb) {
|
||||
if (this.#childrenIgnored(target))
|
||||
return cb();
|
||||
if (this.signal?.aborted)
|
||||
cb();
|
||||
if (this.paused) {
|
||||
this.onResume(() => this.walkCB2Sync(target, patterns, processor, cb));
|
||||
return;
|
||||
}
|
||||
processor.processPatterns(target, patterns);
|
||||
// done processing. all of the above is sync, can be abstracted out.
|
||||
// subwalks is a map of paths to the entry filters they need
|
||||
// matches is a map of paths to [absolute, ifDir] tuples.
|
||||
let tasks = 1;
|
||||
const next = () => {
|
||||
if (--tasks === 0)
|
||||
cb();
|
||||
};
|
||||
for (const [m, absolute, ifDir] of processor.matches.entries()) {
|
||||
if (this.#ignored(m))
|
||||
continue;
|
||||
this.matchSync(m, absolute, ifDir);
|
||||
}
|
||||
for (const t of processor.subwalkTargets()) {
|
||||
if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
|
||||
continue;
|
||||
}
|
||||
tasks++;
|
||||
const children = t.readdirSync();
|
||||
this.walkCB3Sync(t, children, processor, next);
|
||||
}
|
||||
next();
|
||||
}
|
||||
walkCB3Sync(target, entries, processor, cb) {
|
||||
processor = processor.filterEntries(target, entries);
|
||||
let tasks = 1;
|
||||
const next = () => {
|
||||
if (--tasks === 0)
|
||||
cb();
|
||||
};
|
||||
for (const [m, absolute, ifDir] of processor.matches.entries()) {
|
||||
if (this.#ignored(m))
|
||||
continue;
|
||||
this.matchSync(m, absolute, ifDir);
|
||||
}
|
||||
for (const [target, patterns] of processor.subwalks.entries()) {
|
||||
tasks++;
|
||||
this.walkCB2Sync(target, patterns, processor.child(), next);
|
||||
}
|
||||
next();
|
||||
}
|
||||
}
|
||||
export class GlobWalker extends GlobUtil {
|
||||
matches;
|
||||
constructor(patterns, path, opts) {
|
||||
super(patterns, path, opts);
|
||||
this.matches = new Set();
|
||||
}
|
||||
matchEmit(e) {
|
||||
this.matches.add(e);
|
||||
}
|
||||
async walk() {
|
||||
if (this.signal?.aborted)
|
||||
throw this.signal.reason;
|
||||
if (this.path.isUnknown()) {
|
||||
await this.path.lstat();
|
||||
}
|
||||
await new Promise((res, rej) => {
|
||||
this.walkCB(this.path, this.patterns, () => {
|
||||
if (this.signal?.aborted) {
|
||||
rej(this.signal.reason);
|
||||
}
|
||||
else {
|
||||
res(this.matches);
|
||||
}
|
||||
});
|
||||
});
|
||||
return this.matches;
|
||||
}
|
||||
walkSync() {
|
||||
if (this.signal?.aborted)
|
||||
throw this.signal.reason;
|
||||
if (this.path.isUnknown()) {
|
||||
this.path.lstatSync();
|
||||
}
|
||||
// nothing for the callback to do, because this never pauses
|
||||
this.walkCBSync(this.path, this.patterns, () => {
|
||||
if (this.signal?.aborted)
|
||||
throw this.signal.reason;
|
||||
});
|
||||
return this.matches;
|
||||
}
|
||||
}
|
||||
export class GlobStream extends GlobUtil {
|
||||
results;
|
||||
constructor(patterns, path, opts) {
|
||||
super(patterns, path, opts);
|
||||
this.results = new Minipass({
|
||||
signal: this.signal,
|
||||
objectMode: true,
|
||||
});
|
||||
this.results.on('drain', () => this.resume());
|
||||
this.results.on('resume', () => this.resume());
|
||||
}
|
||||
matchEmit(e) {
|
||||
this.results.write(e);
|
||||
if (!this.results.flowing)
|
||||
this.pause();
|
||||
}
|
||||
stream() {
|
||||
const target = this.path;
|
||||
if (target.isUnknown()) {
|
||||
target.lstat().then(() => {
|
||||
this.walkCB(target, this.patterns, () => this.results.end());
|
||||
});
|
||||
}
|
||||
else {
|
||||
this.walkCB(target, this.patterns, () => this.results.end());
|
||||
}
|
||||
return this.results;
|
||||
}
|
||||
streamSync() {
|
||||
if (this.path.isUnknown()) {
|
||||
this.path.lstatSync();
|
||||
}
|
||||
this.walkCBSync(this.path, this.patterns, () => this.results.end());
|
||||
return this.results;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=walker.js.map
|
1
@capacitor/cli/node_modules/glob/dist/mjs/walker.js.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/glob/dist/mjs/walker.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
97
@capacitor/cli/node_modules/glob/package.json
generated
vendored
Normal file
97
@capacitor/cli/node_modules/glob/package.json
generated
vendored
Normal file
|
@ -0,0 +1,97 @@
|
|||
{
|
||||
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
|
||||
"name": "glob",
|
||||
"description": "the most correct and second fastest glob implementation in JavaScript",
|
||||
"version": "9.3.5",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/isaacs/node-glob.git"
|
||||
},
|
||||
"main": "./dist/cjs/index-cjs.js",
|
||||
"module": "./dist/mjs/index.js",
|
||||
"types": "./dist/mjs/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./dist/mjs/index.d.ts",
|
||||
"default": "./dist/mjs/index.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/cjs/index.d.ts",
|
||||
"default": "./dist/cjs/index-cjs.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"preversion": "npm test",
|
||||
"postversion": "npm publish",
|
||||
"prepublishOnly": "git push origin --follow-tags",
|
||||
"preprepare": "rm -rf dist",
|
||||
"prepare": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json",
|
||||
"postprepare": "bash fixup.sh",
|
||||
"pretest": "npm run prepare",
|
||||
"presnap": "npm run prepare",
|
||||
"test": "c8 tap",
|
||||
"snap": "c8 tap",
|
||||
"format": "prettier --write . --loglevel warn",
|
||||
"typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts",
|
||||
"prepublish": "npm run benchclean",
|
||||
"profclean": "rm -f v8.log profile.txt",
|
||||
"test-regen": "npm run profclean && TEST_REGEN=1 node --no-warnings --loader ts-node/esm test/00-setup.ts",
|
||||
"prebench": "npm run prepare",
|
||||
"bench": "bash benchmark.sh",
|
||||
"preprof": "npm run prepare",
|
||||
"prof": "bash prof.sh",
|
||||
"benchclean": "node benchclean.js"
|
||||
},
|
||||
"prettier": {
|
||||
"semi": false,
|
||||
"printWidth": 75,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"singleQuote": true,
|
||||
"jsxSingleQuote": false,
|
||||
"bracketSameLine": true,
|
||||
"arrowParens": "avoid",
|
||||
"endOfLine": "lf"
|
||||
},
|
||||
"dependencies": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"minimatch": "^8.0.2",
|
||||
"minipass": "^4.2.4",
|
||||
"path-scurry": "^1.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.11.18",
|
||||
"@types/tap": "^15.0.7",
|
||||
"c8": "^7.12.0",
|
||||
"memfs": "^3.4.13",
|
||||
"mkdirp": "^2.1.4",
|
||||
"prettier": "^2.8.3",
|
||||
"rimraf": "^4.1.3",
|
||||
"tap": "^16.3.4",
|
||||
"ts-node": "^10.9.1",
|
||||
"typedoc": "^0.23.24",
|
||||
"typescript": "^4.9.4"
|
||||
},
|
||||
"tap": {
|
||||
"before": "test/00-setup.ts",
|
||||
"coverage": false,
|
||||
"node-arg": [
|
||||
"--no-warnings",
|
||||
"--loader",
|
||||
"ts-node/esm"
|
||||
],
|
||||
"ts": false
|
||||
},
|
||||
"license": "ISC",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16 || 14 >=14.17"
|
||||
}
|
||||
}
|
15
@capacitor/cli/node_modules/minimatch/LICENSE
generated
vendored
Normal file
15
@capacitor/cli/node_modules/minimatch/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
The ISC License
|
||||
|
||||
Copyright (c) 2011-2023 Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
459
@capacitor/cli/node_modules/minimatch/README.md
generated
vendored
Normal file
459
@capacitor/cli/node_modules/minimatch/README.md
generated
vendored
Normal file
|
@ -0,0 +1,459 @@
|
|||
# minimatch
|
||||
|
||||
A minimal matching utility.
|
||||
|
||||
This is the matching library used internally by npm.
|
||||
|
||||
It works by converting glob expressions into JavaScript `RegExp`
|
||||
objects.
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// hybrid module, load with require() or import
|
||||
import { minimatch } from 'minimatch'
|
||||
// or:
|
||||
const { minimatch } = require('minimatch')
|
||||
|
||||
// default export also works
|
||||
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 `Minipass.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 adjascent `**` 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`.
|
||||
|
||||
## 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)`.
|
2
@capacitor/cli/node_modules/minimatch/dist/cjs/assert-valid-pattern.d.ts
generated
vendored
Normal file
2
@capacitor/cli/node_modules/minimatch/dist/cjs/assert-valid-pattern.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
export declare const assertValidPattern: (pattern: any) => void;
|
||||
//# sourceMappingURL=assert-valid-pattern.d.ts.map
|
1
@capacitor/cli/node_modules/minimatch/dist/cjs/assert-valid-pattern.d.ts.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/minimatch/dist/cjs/assert-valid-pattern.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"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,GAAG,KAAK,IAUlD,CAAA"}
|
14
@capacitor/cli/node_modules/minimatch/dist/cjs/assert-valid-pattern.js
generated
vendored
Normal file
14
@capacitor/cli/node_modules/minimatch/dist/cjs/assert-valid-pattern.js
generated
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
"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
@capacitor/cli/node_modules/minimatch/dist/cjs/assert-valid-pattern.js.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/minimatch/dist/cjs/assert-valid-pattern.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"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,GAA2B,CACxD,OAAY,EACe,EAAE;IAC7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAA;KACvC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,kBAAkB,EAAE;QACvC,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAA;KAC3C;AACH,CAAC,CAAA;AAVY,QAAA,kBAAkB,sBAU9B","sourcesContent":["const MAX_PATTERN_LENGTH = 1024 * 64\nexport const assertValidPattern: (pattern: any) => void = (\n pattern: any\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"]}
|
24
@capacitor/cli/node_modules/minimatch/dist/cjs/ast.d.ts
generated
vendored
Normal file
24
@capacitor/cli/node_modules/minimatch/dist/cjs/ast.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
import { MinimatchOptions, MMRegExp } from './index.js';
|
||||
export type ExtglobType = '!' | '?' | '+' | '*' | '@';
|
||||
export declare class AST {
|
||||
#private;
|
||||
type: ExtglobType | null;
|
||||
constructor(type: ExtglobType | null, parent?: AST, options?: MinimatchOptions);
|
||||
get hasMagic(): boolean | undefined;
|
||||
toString(): string;
|
||||
push(...parts: (string | AST)[]): void;
|
||||
toJSON(): any[];
|
||||
isStart(): boolean;
|
||||
isEnd(): boolean;
|
||||
copyIn(part: AST | string): void;
|
||||
clone(parent: AST): AST;
|
||||
static fromGlob(pattern: string, options?: MinimatchOptions): AST;
|
||||
toMMPattern(): MMRegExp | string;
|
||||
toRegExpSource(): [
|
||||
re: string,
|
||||
body: string,
|
||||
hasMagic: boolean,
|
||||
uflag: boolean
|
||||
];
|
||||
}
|
||||
//# sourceMappingURL=ast.d.ts.map
|
1
@capacitor/cli/node_modules/minimatch/dist/cjs/ast.d.ts.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/minimatch/dist/cjs/ast.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAyCvD,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AAkCrD,qBAAa,GAAG;;IACd,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;gBAiBtB,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;IA+ClB,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE;IAY/B,MAAM;IAgBN,OAAO,IAAI,OAAO;IAgBlB,KAAK,IAAI,OAAO;IAYhB,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAKzB,KAAK,CAAC,MAAM,EAAE,GAAG;IAsIjB,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAQ/D,WAAW,IAAI,QAAQ,GAAG,MAAM;IAgGhC,cAAc,IAAI;QAChB,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,OAAO;KACf;CAoKF"}
|
566
@capacitor/cli/node_modules/minimatch/dist/cjs/ast.js
generated
vendored
Normal file
566
@capacitor/cli/node_modules/minimatch/dist/cjs/ast.js
generated
vendored
Normal file
|
@ -0,0 +1,566 @@
|
|||
"use strict";
|
||||
// parse a single path portion
|
||||
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);
|
||||
// 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')
|
||||
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;
|
||||
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() {
|
||||
if (this.#toString !== undefined)
|
||||
return this.#toString;
|
||||
if (!this.type) {
|
||||
return (this.#toString = this.#parts.map(p => String(p)).join(''));
|
||||
}
|
||||
else {
|
||||
return (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 AST && 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 AST && 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 AST(this.type, parent);
|
||||
for (const p of this.#parts) {
|
||||
c.copyIn(p);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
static #parseAST(str, ast, pos, opt) {
|
||||
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;
|
||||
}
|
||||
if (!opt.noext && isExtglobType(c) && str.charAt(i) === '(') {
|
||||
ast.push(acc);
|
||||
acc = '';
|
||||
const ext = new AST(c, ast);
|
||||
i = AST.#parseAST(str, ext, i, opt);
|
||||
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 AST(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;
|
||||
}
|
||||
if (isExtglobType(c) && str.charAt(i) === '(') {
|
||||
part.push(acc);
|
||||
acc = '';
|
||||
const ext = new AST(c, part);
|
||||
part.push(ext);
|
||||
i = AST.#parseAST(str, ext, i, opt);
|
||||
continue;
|
||||
}
|
||||
if (c === '|') {
|
||||
part.push(acc);
|
||||
acc = '';
|
||||
parts.push(part);
|
||||
part = new AST(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;
|
||||
}
|
||||
static fromGlob(pattern, options = {}) {
|
||||
const ast = new AST(null, undefined, options);
|
||||
AST.#parseAST(pattern, ast, 0, options);
|
||||
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,
|
||||
});
|
||||
}
|
||||
// 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() {
|
||||
if (this.#root === this)
|
||||
this.#fillNegs();
|
||||
if (!this.type) {
|
||||
const noEmpty = this.isStart() && this.isEnd();
|
||||
const src = this.#parts
|
||||
.map(p => {
|
||||
const [re, _, hasMagic, uflag] = typeof p === 'string'
|
||||
? AST.#parseGlob(p, this.#hasMagic, noEmpty)
|
||||
: p.toRegExpSource();
|
||||
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 .
|
||||
(this.#options.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 = !this.#options.dot && 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,
|
||||
];
|
||||
}
|
||||
// some kind of extglob
|
||||
const start = this.type === '!' ? '(?:(?!(?:' : '(?:';
|
||||
const body = 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();
|
||||
this.#uflag = this.#uflag || uflag;
|
||||
return re;
|
||||
})
|
||||
.filter(p => !(this.isStart() && this.isEnd()) || !!p)
|
||||
.join('|');
|
||||
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();
|
||||
this.#parts = [s];
|
||||
this.type = null;
|
||||
this.#hasMagic = undefined;
|
||||
return [s, (0, unescape_js_1.unescape)(this.toString()), false, false];
|
||||
}
|
||||
// an empty !() is exactly equivalent to a starNoEmpty
|
||||
let final = '';
|
||||
if (this.type === '!' && this.#emptyExt) {
|
||||
final =
|
||||
(this.isStart() && !this.#options.dot ? startNoDot : '') + starNoEmpty;
|
||||
}
|
||||
else {
|
||||
const close = this.type === '!'
|
||||
? // !() must match something,but !(x) can match ''
|
||||
'))' +
|
||||
(this.isStart() && !this.#options.dot ? startNoDot : '') +
|
||||
star +
|
||||
')'
|
||||
: this.type === '@'
|
||||
? ')'
|
||||
: `)${this.type}`;
|
||||
final = start + body + close;
|
||||
}
|
||||
return [
|
||||
final,
|
||||
(0, unescape_js_1.unescape)(body),
|
||||
(this.#hasMagic = !!this.#hasMagic),
|
||||
this.#uflag,
|
||||
];
|
||||
}
|
||||
static #parseGlob(glob, hasMagic, noEmpty = false) {
|
||||
let escaping = false;
|
||||
let re = '';
|
||||
let uflag = 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 (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 === '*') {
|
||||
if (noEmpty && glob === '*')
|
||||
re += starNoEmpty;
|
||||
else
|
||||
re += star;
|
||||
hasMagic = true;
|
||||
continue;
|
||||
}
|
||||
if (c === '?') {
|
||||
re += qmark;
|
||||
hasMagic = true;
|
||||
continue;
|
||||
}
|
||||
re += regExpEscape(c);
|
||||
}
|
||||
return [re, (0, unescape_js_1.unescape)(glob), !!hasMagic, uflag];
|
||||
}
|
||||
}
|
||||
exports.AST = AST;
|
||||
//# sourceMappingURL=ast.js.map
|
1
@capacitor/cli/node_modules/minimatch/dist/cjs/ast.js.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/minimatch/dist/cjs/ast.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
8
@capacitor/cli/node_modules/minimatch/dist/cjs/brace-expressions.d.ts
generated
vendored
Normal file
8
@capacitor/cli/node_modules/minimatch/dist/cjs/brace-expressions.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
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
@capacitor/cli/node_modules/minimatch/dist/cjs/brace-expressions.d.ts.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/minimatch/dist/cjs/brace-expressions.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"brace-expressions.d.ts","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":"AA+BA,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,SACf,MAAM,YACF,MAAM,qBA8HjB,CAAA"}
|
152
@capacitor/cli/node_modules/minimatch/dist/cjs/brace-expressions.js
generated
vendored
Normal file
152
@capacitor/cli/node_modules/minimatch/dist/cjs/brace-expressions.js
generated
vendored
Normal file
|
@ -0,0 +1,152 @@
|
|||
"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
|
1
@capacitor/cli/node_modules/minimatch/dist/cjs/brace-expressions.js.map
generated
vendored
Normal file
1
@capacitor/cli/node_modules/minimatch/dist/cjs/brace-expressions.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
12
@capacitor/cli/node_modules/minimatch/dist/cjs/escape.d.ts
generated
vendored
Normal file
12
@capacitor/cli/node_modules/minimatch/dist/cjs/escape.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { MinimatchOptions } from './index.js';
|
||||
/**
|
||||
* Escape all magic characters in a glob pattern.
|
||||
*
|
||||
* If the {@link windowsPathsNoEscape | GlobOptions.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.
|
||||
*/
|
||||
export declare const escape: (s: string, { windowsPathsNoEscape, }?: Pick<MinimatchOptions, 'windowsPathsNoEscape'>) => string;
|
||||
//# sourceMappingURL=escape.d.ts.map
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue