minimatch 7.4.6 → 7.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +98 -0
- package/dist/cjs/assert-valid-pattern.d.ts +2 -0
- package/dist/cjs/assert-valid-pattern.d.ts.map +1 -0
- package/dist/cjs/assert-valid-pattern.js +14 -0
- package/dist/cjs/assert-valid-pattern.js.map +1 -0
- package/dist/cjs/ast.d.ts +25 -0
- package/dist/cjs/ast.d.ts.map +1 -0
- package/dist/cjs/ast.js +719 -0
- package/dist/cjs/ast.js.map +1 -0
- package/dist/cjs/index.d.ts +5 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +147 -94
- package/dist/cjs/index.js.map +1 -1
- package/dist/mjs/assert-valid-pattern.d.ts +2 -0
- package/dist/mjs/assert-valid-pattern.d.ts.map +1 -0
- package/dist/mjs/assert-valid-pattern.js +10 -0
- package/dist/mjs/assert-valid-pattern.js.map +1 -0
- package/dist/mjs/ast.d.ts +25 -0
- package/dist/mjs/ast.d.ts.map +1 -0
- package/dist/mjs/ast.js +715 -0
- package/dist/mjs/ast.js.map +1 -0
- package/dist/mjs/index.d.ts +5 -0
- package/dist/mjs/index.d.ts.map +1 -1
- package/dist/mjs/index.js +147 -94
- package/dist/mjs/index.js.map +1 -1
- package/package.json +2 -2
package/changelog.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# change log
|
|
2
|
+
|
|
3
|
+
## 7.4
|
|
4
|
+
|
|
5
|
+
- Add `escape()` method
|
|
6
|
+
- Add `unescape()` method
|
|
7
|
+
- Add `Minimatch.hasMagic()` method
|
|
8
|
+
|
|
9
|
+
## 7.3
|
|
10
|
+
|
|
11
|
+
- Add support for posix character classes in a unicode-aware way.
|
|
12
|
+
|
|
13
|
+
## 7.2
|
|
14
|
+
|
|
15
|
+
- Add `windowsNoMagicRoot` option
|
|
16
|
+
|
|
17
|
+
## 7.1
|
|
18
|
+
|
|
19
|
+
- Add `optimizationLevel` configuration option, and revert the
|
|
20
|
+
default back to the 6.2 style minimal optimizations, making the
|
|
21
|
+
advanced transforms introduced in 7.0 opt-in. Also, process
|
|
22
|
+
provided file paths in the same way in optimizationLevel:2
|
|
23
|
+
mode, so _most_ things that matched with optimizationLevel 1 or
|
|
24
|
+
0 _should_ match with level 2 as well. However, level 1 is the
|
|
25
|
+
default, out of an abundance of caution.
|
|
26
|
+
|
|
27
|
+
## 7.0
|
|
28
|
+
|
|
29
|
+
- Preprocess patterns to simplify complicated patterns and reduce
|
|
30
|
+
out `..` pattern portions where possible. Note that this means
|
|
31
|
+
a pattern like `a/b/../*` will be equivalent to `a/*`, and will
|
|
32
|
+
_not_ match the string `a/b/../c`. If this causes problems, it
|
|
33
|
+
can be addressed in a patch release by resolving `..` portions
|
|
34
|
+
in the test string.
|
|
35
|
+
|
|
36
|
+
## 6.2
|
|
37
|
+
|
|
38
|
+
- Add nocaseMagicOnly flag
|
|
39
|
+
|
|
40
|
+
## 6.1
|
|
41
|
+
|
|
42
|
+
- Handle UNC paths on Windows
|
|
43
|
+
|
|
44
|
+
This adds some slightly modified behavior when a pattern or path starts
|
|
45
|
+
with `//` on Windows.
|
|
46
|
+
|
|
47
|
+
- In the case of `//?/<drive letter>:/...`, the `?` is treated as a
|
|
48
|
+
literal character, rather than a wildcard. That is, `//?/c:` will
|
|
49
|
+
_not_ match `//x/c:`.
|
|
50
|
+
- UNC patterns starting with `//?/<drive letter>:/` will match file paths
|
|
51
|
+
starting with `<drive letter>:` if the drive letters match
|
|
52
|
+
case-insensitively.
|
|
53
|
+
- File paths starting with `//?/<drive letter>:/` will match file
|
|
54
|
+
patterns starting with `<drive letter>:` if the drive letters match
|
|
55
|
+
case-insensitively.
|
|
56
|
+
|
|
57
|
+
- Add `{preserveMultipleSlashes:true}` option to suppress the
|
|
58
|
+
behavior where multiple consecutive `/` characters would be
|
|
59
|
+
effectively coerced into a single path portion separator.
|
|
60
|
+
|
|
61
|
+
## 6.0
|
|
62
|
+
|
|
63
|
+
- hybrid module supporting both `require()` and `import`
|
|
64
|
+
- exported types
|
|
65
|
+
|
|
66
|
+
## 5.1
|
|
67
|
+
|
|
68
|
+
- use windowsPathNoEscape/allowWindowsEscape opts
|
|
69
|
+
- make character classes more faithful to bash glob behavior
|
|
70
|
+
- fix handling of escapes
|
|
71
|
+
- treat invalid character classes as non-matching pattern
|
|
72
|
+
rather than escaped literals
|
|
73
|
+
|
|
74
|
+
## 5.0
|
|
75
|
+
|
|
76
|
+
- brace-expansion: ignore only blocks that begins with $
|
|
77
|
+
- Expect exclusively forward slash as path sep, same as node-glob
|
|
78
|
+
|
|
79
|
+
## 4.2
|
|
80
|
+
|
|
81
|
+
- makeRe: globstar should match zero+ path portions
|
|
82
|
+
- Fix bug with escaped '@' in patterns
|
|
83
|
+
|
|
84
|
+
## 4.1
|
|
85
|
+
|
|
86
|
+
- treat `nocase:true` as always having magic
|
|
87
|
+
- expose GLOBSTAR marker
|
|
88
|
+
|
|
89
|
+
## 4.0
|
|
90
|
+
|
|
91
|
+
- Update to modern JS syntax
|
|
92
|
+
- Add `allowWindowsEscape` option
|
|
93
|
+
|
|
94
|
+
## 3.x
|
|
95
|
+
|
|
96
|
+
- Added basic redos protection
|
|
97
|
+
- Handle unfinished `!(` extglob patterns
|
|
98
|
+
- Add `partial: true` option
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assertValidPattern = void 0;
|
|
4
|
+
const MAX_PATTERN_LENGTH = 1024 * 64;
|
|
5
|
+
const assertValidPattern = (pattern) => {
|
|
6
|
+
if (typeof pattern !== 'string') {
|
|
7
|
+
throw new TypeError('invalid pattern');
|
|
8
|
+
}
|
|
9
|
+
if (pattern.length > MAX_PATTERN_LENGTH) {
|
|
10
|
+
throw new TypeError('pattern is too long');
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
exports.assertValidPattern = assertValidPattern;
|
|
14
|
+
//# sourceMappingURL=assert-valid-pattern.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { MinimatchOptions, MMRegExp } from './index.js';
|
|
2
|
+
export type ExtglobType = '!' | '?' | '+' | '*' | '@';
|
|
3
|
+
export declare class AST {
|
|
4
|
+
#private;
|
|
5
|
+
type: ExtglobType | null;
|
|
6
|
+
constructor(type: ExtglobType | null, parent?: AST, options?: MinimatchOptions);
|
|
7
|
+
get hasMagic(): boolean | undefined;
|
|
8
|
+
toString(): string;
|
|
9
|
+
push(...parts: (string | AST)[]): void;
|
|
10
|
+
toJSON(): any[];
|
|
11
|
+
isStart(): boolean;
|
|
12
|
+
isEnd(): boolean;
|
|
13
|
+
copyIn(part: AST | string): void;
|
|
14
|
+
clone(parent: AST): AST;
|
|
15
|
+
static fromGlob(pattern: string, options?: MinimatchOptions): AST;
|
|
16
|
+
toMMPattern(): MMRegExp | string;
|
|
17
|
+
get options(): MinimatchOptions;
|
|
18
|
+
toRegExpSource(): [
|
|
19
|
+
re: string,
|
|
20
|
+
body: string,
|
|
21
|
+
hasMagic: boolean,
|
|
22
|
+
uflag: boolean
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=ast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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;AAiErD,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;IA0RjB,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAQ/D,WAAW,IAAI,QAAQ,GAAG,MAAM;IA2BhC,IAAI,OAAO,qBAEV;IAuED,cAAc,IAAI;QAChB,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,OAAO;KACf;CA4KF"}
|