Upgrade Ava to v4
This commit is contained in:
parent
9a40cc5274
commit
ce89f1b611
1153 changed files with 27264 additions and 95308 deletions
181
node_modules/matcher/index.d.ts
generated
vendored
181
node_modules/matcher/index.d.ts
generated
vendored
|
|
@ -1,85 +1,144 @@
|
|||
declare namespace matcher {
|
||||
interface Options {
|
||||
/**
|
||||
Treat uppercase and lowercase characters as being the same.
|
||||
export 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.
|
||||
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;
|
||||
}
|
||||
@default false
|
||||
|
||||
@example
|
||||
```
|
||||
import {isMatch} from 'matcher';
|
||||
|
||||
isMatch('UNICORN', 'UNI*', {caseSensitive: true});
|
||||
//=> true
|
||||
|
||||
isMatch('UNICORN', 'unicorn', {caseSensitive: true});
|
||||
//=> false
|
||||
|
||||
isMatch('unicorn', ['tri*', 'UNI*'], {caseSensitive: true});
|
||||
//=> false
|
||||
```
|
||||
*/
|
||||
readonly caseSensitive?: boolean;
|
||||
/**
|
||||
Require all negated patterns to not match and any normal patterns to match at least once. Otherwise, it will be a no-match condition.
|
||||
|
||||
@default false
|
||||
|
||||
@example
|
||||
```
|
||||
import {matcher} from 'matcher';
|
||||
|
||||
// Find text strings containing both "edge" and "tiger" in arbitrary order, but not "stunt".
|
||||
const demo = (strings) => matcher(strings, ['*edge*', '*tiger*', '!*stunt*'], {allPatterns: true});
|
||||
|
||||
demo(['Hey, tiger!', 'tiger has edge over hyenas', 'pushing a tiger over the edge is a stunt']);
|
||||
//=> ['tiger has edge over hyenas']
|
||||
```
|
||||
|
||||
@example
|
||||
```
|
||||
import {matcher} from 'matcher';
|
||||
|
||||
matcher(['foo', 'for', 'bar'], ['f*', 'b*', '!x*'], {allPatterns: true});
|
||||
//=> ['foo', 'for', 'bar']
|
||||
|
||||
matcher(['foo', 'for', 'bar'], ['f*'], {allPatterns: true});
|
||||
//=> []
|
||||
```
|
||||
*/
|
||||
readonly allPatterns?: boolean;
|
||||
}
|
||||
|
||||
declare const matcher: {
|
||||
/**
|
||||
Simple [wildcard](https://en.wikipedia.org/wiki/Wildcard_character) matching.
|
||||
/**
|
||||
Simple [wildcard](https://en.wikipedia.org/wiki/Wildcard_character) matching.
|
||||
|
||||
It matches even across newlines. For example, `foo*r` will match `foo\nbar`.
|
||||
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`.
|
||||
@param inputs - The string or array of strings to match.
|
||||
@param patterns - The string or array of string patterns. Use `*` to match zero or more characters. A leading `!` negates the pattern.
|
||||
@returns An array of `inputs` filtered based on the `patterns`.
|
||||
|
||||
@example
|
||||
```
|
||||
import matcher = require('matcher');
|
||||
@example
|
||||
```
|
||||
import {matcher} from 'matcher';
|
||||
|
||||
matcher(['foo', 'bar', 'moo'], ['*oo', '!foo']);
|
||||
//=> ['moo']
|
||||
matcher(['foo', 'bar', 'moo'], ['*oo', '!foo']);
|
||||
//=> ['moo']
|
||||
|
||||
matcher(['foo', 'bar', 'moo'], ['!*oo']);
|
||||
//=> ['bar']
|
||||
```
|
||||
*/
|
||||
(inputs: readonly string[], patterns: readonly string[], options?: matcher.Options): string[];
|
||||
matcher(['foo', 'bar', 'moo'], ['!*oo']);
|
||||
//=> ['bar']
|
||||
|
||||
/**
|
||||
It matches even across newlines. For example, `foo*r` will match `foo\nbar`.
|
||||
matcher('moo', ['']);
|
||||
//=> []
|
||||
|
||||
@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`.
|
||||
matcher('moo', []);
|
||||
//=> []
|
||||
|
||||
@example
|
||||
```
|
||||
import matcher = require('matcher');
|
||||
matcher([''], ['']);
|
||||
//=> ['']
|
||||
```
|
||||
*/
|
||||
export function matcher(
|
||||
inputs: string | readonly string[],
|
||||
patterns: string | readonly string[],
|
||||
options?: Options,
|
||||
): string[];
|
||||
|
||||
matcher.isMatch('unicorn', 'uni*');
|
||||
//=> true
|
||||
/**
|
||||
It matches even across newlines. For example, `foo*r` will match `foo\nbar`.
|
||||
|
||||
matcher.isMatch('unicorn', '*corn');
|
||||
//=> true
|
||||
@param inputs - The string or array of strings to match.
|
||||
@param patterns - The string or array of string patterns. Use `*` to match zero or more characters. A leading `!` negates the pattern.
|
||||
@returns A `boolean` of whether any of given `inputs` matches all the `patterns`.
|
||||
|
||||
matcher.isMatch('unicorn', 'un*rn');
|
||||
//=> true
|
||||
@example
|
||||
```
|
||||
import {isMatch} from 'matcher';
|
||||
|
||||
matcher.isMatch('rainbow', '!unicorn');
|
||||
//=> true
|
||||
isMatch('unicorn', 'uni*');
|
||||
//=> true
|
||||
|
||||
matcher.isMatch('foo bar baz', 'foo b* b*');
|
||||
//=> true
|
||||
isMatch('unicorn', '*corn');
|
||||
//=> true
|
||||
|
||||
matcher.isMatch('unicorn', 'uni\\*');
|
||||
//=> false
|
||||
isMatch('unicorn', 'un*rn');
|
||||
//=> true
|
||||
|
||||
matcher.isMatch('UNICORN', 'UNI*', {caseSensitive: true});
|
||||
//=> true
|
||||
isMatch('rainbow', '!unicorn');
|
||||
//=> true
|
||||
|
||||
matcher.isMatch('UNICORN', 'unicorn', {caseSensitive: true});
|
||||
//=> false
|
||||
isMatch('foo bar baz', 'foo b* b*');
|
||||
//=> true
|
||||
|
||||
matcher.isMatch(['foo', 'bar'], 'f*');
|
||||
//=> true
|
||||
isMatch('unicorn', 'uni\\*');
|
||||
//=> false
|
||||
|
||||
matcher.isMatch(['foo', 'bar'], ['a*', 'b*']);
|
||||
//=> true
|
||||
isMatch(['foo', 'bar'], 'f*');
|
||||
//=> true
|
||||
|
||||
matcher.isMatch('unicorn', ['tri*', 'UNI*'], {caseSensitive: true});
|
||||
//=> false
|
||||
```
|
||||
*/
|
||||
isMatch: (input: string | readonly string[], pattern: string | readonly string[], options?: matcher.Options) => boolean;
|
||||
};
|
||||
isMatch(['foo', 'bar'], ['a*', 'b*']);
|
||||
//=> true
|
||||
|
||||
export = matcher;
|
||||
isMatch('unicorn', ['']);
|
||||
//=> false
|
||||
|
||||
isMatch('unicorn', []);
|
||||
//=> false
|
||||
|
||||
isMatch([], 'bar');
|
||||
//=> false
|
||||
|
||||
isMatch([], []);
|
||||
//=> false
|
||||
|
||||
isMatch([''], ['']);
|
||||
//=> true
|
||||
```
|
||||
*/
|
||||
export function isMatch(
|
||||
inputs: string | readonly string[],
|
||||
patterns: string | readonly string[],
|
||||
options?: Options,
|
||||
): boolean;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue