This commit is contained in:
2022-09-30 05:39:11 +00:00
parent 41ee9463ae
commit 4687fa49bc
11418 changed files with 1312504 additions and 0 deletions

85
buildfiles/node_modules/matcher/index.d.ts generated vendored Normal file
View File

@ -0,0 +1,85 @@
declare namespace matcher {
interface Options {
/**
Treat uppercase and lowercase characters as being the same.
Ensure you use this correctly. For example, files and directories should be matched case-insensitively, while most often, object keys should be matched case-sensitively.
@default false
*/
readonly caseSensitive?: boolean;
}
}
declare const matcher: {
/**
Simple [wildcard](https://en.wikipedia.org/wiki/Wildcard_character) matching.
It matches even across newlines. For example, `foo*r` will match `foo\nbar`.
@param inputs - Strings to match.
@param patterns - Use `*` to match zero or more characters. A pattern starting with `!` will be negated.
@returns The `inputs` filtered based on the `patterns`.
@example
```
import matcher = require('matcher');
matcher(['foo', 'bar', 'moo'], ['*oo', '!foo']);
//=> ['moo']
matcher(['foo', 'bar', 'moo'], ['!*oo']);
//=> ['bar']
```
*/
(inputs: readonly string[], patterns: readonly string[], options?: matcher.Options): string[];
/**
It matches even across newlines. For example, `foo*r` will match `foo\nbar`.
@param input - String or array of strings to match.
@param pattern - String or array of string patterns. Use `*` to match zero or more characters. A pattern starting with `!` will be negated.
@returns Whether any given `input` matches every given `pattern`.
@example
```
import matcher = require('matcher');
matcher.isMatch('unicorn', 'uni*');
//=> true
matcher.isMatch('unicorn', '*corn');
//=> true
matcher.isMatch('unicorn', 'un*rn');
//=> true
matcher.isMatch('rainbow', '!unicorn');
//=> true
matcher.isMatch('foo bar baz', 'foo b* b*');
//=> true
matcher.isMatch('unicorn', 'uni\\*');
//=> false
matcher.isMatch('UNICORN', 'UNI*', {caseSensitive: true});
//=> true
matcher.isMatch('UNICORN', 'unicorn', {caseSensitive: true});
//=> false
matcher.isMatch(['foo', 'bar'], 'f*');
//=> true
matcher.isMatch(['foo', 'bar'], ['a*', 'b*']);
//=> true
matcher.isMatch('unicorn', ['tri*', 'UNI*'], {caseSensitive: true});
//=> false
```
*/
isMatch: (input: string | readonly string[], pattern: string | readonly string[], options?: matcher.Options) => boolean;
};
export = matcher;

77
buildfiles/node_modules/matcher/index.js generated vendored Normal file
View File

@ -0,0 +1,77 @@
'use strict';
const escapeStringRegexp = require('escape-string-regexp');
const regexpCache = new Map();
function makeRegexp(pattern, options) {
options = {
caseSensitive: false,
...options
};
const cacheKey = pattern + JSON.stringify(options);
if (regexpCache.has(cacheKey)) {
return regexpCache.get(cacheKey);
}
const negated = pattern[0] === '!';
if (negated) {
pattern = pattern.slice(1);
}
pattern = escapeStringRegexp(pattern).replace(/\\\*/g, '[\\s\\S]*');
const regexp = new RegExp(`^${pattern}$`, options.caseSensitive ? '' : 'i');
regexp.negated = negated;
regexpCache.set(cacheKey, regexp);
return regexp;
}
module.exports = (inputs, patterns, options) => {
if (!(Array.isArray(inputs) && Array.isArray(patterns))) {
throw new TypeError(`Expected two arrays, got ${typeof inputs} ${typeof patterns}`);
}
if (patterns.length === 0) {
return inputs;
}
const isFirstPatternNegated = patterns[0][0] === '!';
patterns = patterns.map(pattern => makeRegexp(pattern, options));
const result = [];
for (const input of inputs) {
// If first pattern is negated we include everything to match user expectation.
let matches = isFirstPatternNegated;
for (const pattern of patterns) {
if (pattern.test(input)) {
matches = !pattern.negated;
}
}
if (matches) {
result.push(input);
}
}
return result;
};
module.exports.isMatch = (input, pattern, options) => {
const inputArray = Array.isArray(input) ? input : [input];
const patternArray = Array.isArray(pattern) ? pattern : [pattern];
return inputArray.some(input => {
return patternArray.every(pattern => {
const regexp = makeRegexp(pattern, options);
const matches = regexp.test(input);
return regexp.negated ? !matches : matches;
});
});
};

9
buildfiles/node_modules/matcher/license generated vendored Normal file
View File

@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.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.

86
buildfiles/node_modules/matcher/package.json generated vendored Normal file
View File

@ -0,0 +1,86 @@
{
"_from": "matcher@^3.0.0",
"_id": "matcher@3.0.0",
"_inBundle": false,
"_integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==",
"_location": "/matcher",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "matcher@^3.0.0",
"name": "matcher",
"escapedName": "matcher",
"rawSpec": "^3.0.0",
"saveSpec": null,
"fetchSpec": "^3.0.0"
},
"_requiredBy": [
"/global-agent"
],
"_resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz",
"_shasum": "bd9060f4c5b70aa8041ccc6f80368760994f30ca",
"_spec": "matcher@^3.0.0",
"_where": "/home/shihaam/www/freezer.shihaam.me/node_modules/global-agent",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/matcher/issues"
},
"bundleDependencies": false,
"dependencies": {
"escape-string-regexp": "^4.0.0"
},
"deprecated": false,
"description": "Simple wildcard matching",
"devDependencies": {
"ava": "^2.4.0",
"matcha": "^0.7.0",
"tsd": "^0.11.0",
"xo": "^0.30.0"
},
"engines": {
"node": ">=10"
},
"files": [
"index.js",
"index.d.ts"
],
"homepage": "https://github.com/sindresorhus/matcher#readme",
"keywords": [
"matcher",
"matching",
"match",
"regex",
"regexp",
"regular",
"expression",
"wildcard",
"pattern",
"string",
"filter",
"glob",
"globber",
"globbing",
"minimatch"
],
"license": "MIT",
"name": "matcher",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/matcher.git"
},
"scripts": {
"bench": "matcha bench.js",
"test": "xo && ava && tsd"
},
"version": "3.0.0",
"xo": {
"rules": {
"@typescript-eslint/member-ordering": "off"
}
}
}

120
buildfiles/node_modules/matcher/readme.md generated vendored Normal file
View File

@ -0,0 +1,120 @@
# matcher [![Build Status](https://travis-ci.com/sindresorhus/matcher.svg?branch=master)](https://travis-ci.com/sindresorhus/matcher)
> Simple [wildcard](https://en.wikipedia.org/wiki/Wildcard_character) matching
Useful when you want to accept loose string input and regexes/globs are too convoluted.
## Install
```
$ npm install matcher
```
## Usage
```js
const matcher = require('matcher');
matcher(['foo', 'bar', 'moo'], ['*oo', '!foo']);
//=> ['moo']
matcher(['foo', 'bar', 'moo'], ['!*oo']);
//=> ['bar']
matcher.isMatch('unicorn', 'uni*');
//=> true
matcher.isMatch('unicorn', '*corn');
//=> true
matcher.isMatch('unicorn', 'un*rn');
//=> true
matcher.isMatch('rainbow', '!unicorn');
//=> true
matcher.isMatch('foo bar baz', 'foo b* b*');
//=> true
matcher.isMatch('unicorn', 'uni\\*');
//=> false
matcher.isMatch('UNICORN', 'UNI*', {caseSensitive: true});
//=> true
matcher.isMatch('UNICORN', 'unicorn', {caseSensitive: true});
//=> false
matcher.isMatch(['foo', 'bar'], 'f*');
//=> true
matcher.isMatch(['foo', 'bar'], ['a*', 'b*']);
//=> true
matcher.isMatch('unicorn', ['tri*', 'UNI*'], {caseSensitive: true});
//=> false
```
## API
It matches even across newlines. For example, `foo*r` will match `foo\nbar`.
### matcher(inputs, patterns, options?)
Accepts an array of `input`'s and `pattern`'s.
Returns an array of `inputs` filtered based on the `patterns`.
### matcher.isMatch(input, pattern, options?)
Accepts either a string or array of strings for both `input` and `pattern`.
Returns a `boolean` of whether any given `input` matches every given `pattern`.
#### input
Type: `string | string[]`
String or array of strings to match.
#### options
Type: `object`
##### caseSensitive
Type: `boolean`\
Default: `false`
Treat uppercase and lowercase characters as being the same.
Ensure you use this correctly. For example, files and directories should be matched case-insensitively, while most often, object keys should be matched case-sensitively.
#### pattern
Type: `string | string[]`
Use `*` to match zero or more characters. A pattern starting with `!` will be negated.
## Benchmark
```
$ npm run bench
```
## Related
- [matcher-cli](https://github.com/sindresorhus/matcher-cli) - CLI for this module
- [multimatch](https://github.com/sindresorhus/multimatch) - Extends `minimatch.match()` with support for multiple patterns
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-matcher?utm_source=npm-matcher&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>