@plugjs/plug 0.0.1
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/LICENSE.md +211 -0
- package/NOTICE.md +13 -0
- package/README.md +7 -0
- package/dist/assert.cjs +72 -0
- package/dist/assert.cjs.map +6 -0
- package/dist/assert.mjs +41 -0
- package/dist/assert.mjs.map +6 -0
- package/dist/async.cjs +58 -0
- package/dist/async.cjs.map +6 -0
- package/dist/async.mjs +30 -0
- package/dist/async.mjs.map +6 -0
- package/dist/build.cjs +136 -0
- package/dist/build.cjs.map +6 -0
- package/dist/build.mjs +110 -0
- package/dist/build.mjs.map +6 -0
- package/dist/files.cjs +113 -0
- package/dist/files.cjs.map +6 -0
- package/dist/files.mjs +88 -0
- package/dist/files.mjs.map +6 -0
- package/dist/fork.cjs +177 -0
- package/dist/fork.cjs.map +6 -0
- package/dist/fork.mjs +151 -0
- package/dist/fork.mjs.map +6 -0
- package/dist/helpers.cjs +129 -0
- package/dist/helpers.cjs.map +6 -0
- package/dist/helpers.mjs +97 -0
- package/dist/helpers.mjs.map +6 -0
- package/dist/index.cjs +25 -0
- package/dist/index.cjs.map +6 -0
- package/dist/index.mjs +7 -0
- package/dist/index.mjs.map +6 -0
- package/dist/log/colors.cjs +129 -0
- package/dist/log/colors.cjs.map +6 -0
- package/dist/log/colors.mjs +93 -0
- package/dist/log/colors.mjs.map +6 -0
- package/dist/log/emit.cjs +109 -0
- package/dist/log/emit.cjs.map +6 -0
- package/dist/log/emit.mjs +83 -0
- package/dist/log/emit.mjs.map +6 -0
- package/dist/log/levels.cjs +75 -0
- package/dist/log/levels.cjs.map +6 -0
- package/dist/log/levels.mjs +41 -0
- package/dist/log/levels.mjs.map +6 -0
- package/dist/log/logger.cjs +129 -0
- package/dist/log/logger.cjs.map +6 -0
- package/dist/log/logger.mjs +104 -0
- package/dist/log/logger.mjs.map +6 -0
- package/dist/log/options.cjs +149 -0
- package/dist/log/options.cjs.map +6 -0
- package/dist/log/options.mjs +124 -0
- package/dist/log/options.mjs.map +6 -0
- package/dist/log/report.cjs +284 -0
- package/dist/log/report.cjs.map +6 -0
- package/dist/log/report.mjs +259 -0
- package/dist/log/report.mjs.map +6 -0
- package/dist/log/spinner.cjs +83 -0
- package/dist/log/spinner.cjs.map +6 -0
- package/dist/log/spinner.mjs +57 -0
- package/dist/log/spinner.mjs.map +6 -0
- package/dist/log.cjs +71 -0
- package/dist/log.cjs.map +6 -0
- package/dist/log.mjs +45 -0
- package/dist/log.mjs.map +6 -0
- package/dist/paths.cjs +158 -0
- package/dist/paths.cjs.map +6 -0
- package/dist/paths.mjs +122 -0
- package/dist/paths.mjs.map +6 -0
- package/dist/pipe.cjs +71 -0
- package/dist/pipe.cjs.map +6 -0
- package/dist/pipe.mjs +44 -0
- package/dist/pipe.mjs.map +6 -0
- package/dist/plugs/copy.cjs +95 -0
- package/dist/plugs/copy.cjs.map +6 -0
- package/dist/plugs/copy.mjs +64 -0
- package/dist/plugs/copy.mjs.map +6 -0
- package/dist/plugs/coverage/analysis.cjs +229 -0
- package/dist/plugs/coverage/analysis.cjs.map +6 -0
- package/dist/plugs/coverage/analysis.mjs +202 -0
- package/dist/plugs/coverage/analysis.mjs.map +6 -0
- package/dist/plugs/coverage/report.cjs +215 -0
- package/dist/plugs/coverage/report.cjs.map +6 -0
- package/dist/plugs/coverage/report.mjs +200 -0
- package/dist/plugs/coverage/report.mjs.map +6 -0
- package/dist/plugs/coverage.cjs +142 -0
- package/dist/plugs/coverage.cjs.map +6 -0
- package/dist/plugs/coverage.mjs +117 -0
- package/dist/plugs/coverage.mjs.map +6 -0
- package/dist/plugs/debug.cjs +50 -0
- package/dist/plugs/debug.cjs.map +6 -0
- package/dist/plugs/debug.mjs +25 -0
- package/dist/plugs/debug.mjs.map +6 -0
- package/dist/plugs/esbuild/bundle-locals.cjs +51 -0
- package/dist/plugs/esbuild/bundle-locals.cjs.map +6 -0
- package/dist/plugs/esbuild/bundle-locals.mjs +26 -0
- package/dist/plugs/esbuild/bundle-locals.mjs.map +6 -0
- package/dist/plugs/esbuild/check-dependencies.cjs +140 -0
- package/dist/plugs/esbuild/check-dependencies.cjs.map +6 -0
- package/dist/plugs/esbuild/check-dependencies.mjs +115 -0
- package/dist/plugs/esbuild/check-dependencies.mjs.map +6 -0
- package/dist/plugs/esbuild/fix-extensions.cjs +91 -0
- package/dist/plugs/esbuild/fix-extensions.cjs.map +6 -0
- package/dist/plugs/esbuild/fix-extensions.mjs +60 -0
- package/dist/plugs/esbuild/fix-extensions.mjs.map +6 -0
- package/dist/plugs/esbuild.cjs +109 -0
- package/dist/plugs/esbuild.cjs.map +6 -0
- package/dist/plugs/esbuild.mjs +83 -0
- package/dist/plugs/esbuild.mjs.map +6 -0
- package/dist/plugs/eslint/runner.cjs +91 -0
- package/dist/plugs/eslint/runner.cjs.map +6 -0
- package/dist/plugs/eslint/runner.mjs +68 -0
- package/dist/plugs/eslint/runner.mjs.map +6 -0
- package/dist/plugs/exec.cjs +128 -0
- package/dist/plugs/exec.cjs.map +6 -0
- package/dist/plugs/exec.mjs +96 -0
- package/dist/plugs/exec.mjs.map +6 -0
- package/dist/plugs/filter.cjs +59 -0
- package/dist/plugs/filter.cjs.map +6 -0
- package/dist/plugs/filter.mjs +34 -0
- package/dist/plugs/filter.mjs.map +6 -0
- package/dist/plugs/mocha/reporter.cjs +140 -0
- package/dist/plugs/mocha/reporter.cjs.map +6 -0
- package/dist/plugs/mocha/reporter.mjs +107 -0
- package/dist/plugs/mocha/reporter.mjs.map +6 -0
- package/dist/plugs/mocha/runner.cjs +73 -0
- package/dist/plugs/mocha/runner.cjs.map +6 -0
- package/dist/plugs/mocha/runner.mjs +44 -0
- package/dist/plugs/mocha/runner.mjs.map +6 -0
- package/dist/plugs/tsc/compiler.cjs +74 -0
- package/dist/plugs/tsc/compiler.cjs.map +6 -0
- package/dist/plugs/tsc/compiler.mjs +43 -0
- package/dist/plugs/tsc/compiler.mjs.map +6 -0
- package/dist/plugs/tsc/options.cjs +82 -0
- package/dist/plugs/tsc/options.cjs.map +6 -0
- package/dist/plugs/tsc/options.mjs +51 -0
- package/dist/plugs/tsc/options.mjs.map +6 -0
- package/dist/plugs/tsc/report.cjs +90 -0
- package/dist/plugs/tsc/report.cjs.map +6 -0
- package/dist/plugs/tsc/report.mjs +59 -0
- package/dist/plugs/tsc/report.mjs.map +6 -0
- package/dist/plugs/tsc/runner.cjs +101 -0
- package/dist/plugs/tsc/runner.cjs.map +6 -0
- package/dist/plugs/tsc/runner.mjs +72 -0
- package/dist/plugs/tsc/runner.mjs.map +6 -0
- package/dist/plugs.cjs +31 -0
- package/dist/plugs.cjs.map +6 -0
- package/dist/plugs.mjs +13 -0
- package/dist/plugs.mjs.map +6 -0
- package/dist/run.cjs +95 -0
- package/dist/run.cjs.map +6 -0
- package/dist/run.mjs +70 -0
- package/dist/run.mjs.map +6 -0
- package/dist/task.cjs +39 -0
- package/dist/task.cjs.map +6 -0
- package/dist/task.mjs +14 -0
- package/dist/task.mjs.map +6 -0
- package/dist/utils/asyncfs.cjs +143 -0
- package/dist/utils/asyncfs.cjs.map +6 -0
- package/dist/utils/asyncfs.mjs +83 -0
- package/dist/utils/asyncfs.mjs.map +6 -0
- package/dist/utils/caller.cjs +59 -0
- package/dist/utils/caller.cjs.map +6 -0
- package/dist/utils/caller.mjs +34 -0
- package/dist/utils/caller.mjs.map +6 -0
- package/dist/utils/match.cjs +69 -0
- package/dist/utils/match.cjs.map +6 -0
- package/dist/utils/match.mjs +38 -0
- package/dist/utils/match.mjs.map +6 -0
- package/dist/utils/options.cjs +41 -0
- package/dist/utils/options.cjs.map +6 -0
- package/dist/utils/options.mjs +16 -0
- package/dist/utils/options.mjs.map +6 -0
- package/dist/utils/walk.cjs +104 -0
- package/dist/utils/walk.cjs.map +6 -0
- package/dist/utils/walk.mjs +79 -0
- package/dist/utils/walk.mjs.map +6 -0
- package/extra/cli.mjs +212 -0
- package/extra/ts-loader.mjs +214 -0
- package/extra/webassembly.d.ts +11 -0
- package/package.json +57 -0
- package/src/assert.ts +47 -0
- package/src/async.ts +50 -0
- package/src/files.ts +129 -0
- package/src/fork.ts +263 -0
- package/src/helpers.ts +145 -0
- package/src/index.ts +20 -0
- package/src/log/colors.ts +119 -0
- package/src/log/emit.ts +125 -0
- package/src/log/levels.ts +65 -0
- package/src/log/logger.ts +171 -0
- package/src/log/options.ts +199 -0
- package/src/log/report.ts +433 -0
- package/src/log/spinner.ts +70 -0
- package/src/log.ts +68 -0
- package/src/paths.ts +213 -0
- package/src/pipe.ts +231 -0
- package/src/plugs/copy.ts +113 -0
- package/src/plugs/coverage/analysis.ts +395 -0
- package/src/plugs/coverage/report.ts +337 -0
- package/src/plugs/coverage.ts +194 -0
- package/src/plugs/debug.ts +35 -0
- package/src/plugs/esbuild/bundle-locals.ts +33 -0
- package/src/plugs/esbuild/check-dependencies.ts +158 -0
- package/src/plugs/esbuild/fix-extensions.ts +108 -0
- package/src/plugs/esbuild.ts +128 -0
- package/src/plugs/eslint/runner.ts +112 -0
- package/src/plugs/exec.ts +215 -0
- package/src/plugs/filter.ts +56 -0
- package/src/plugs/mocha/reporter.ts +152 -0
- package/src/plugs/mocha/runner.ts +77 -0
- package/src/plugs/tsc/compiler.ts +66 -0
- package/src/plugs/tsc/options.ts +97 -0
- package/src/plugs/tsc/report.ts +74 -0
- package/src/plugs/tsc/runner.ts +100 -0
- package/src/plugs.ts +33 -0
- package/src/run.ts +160 -0
- package/src/task.ts +26 -0
- package/src/utils/asyncfs.ts +82 -0
- package/src/utils/caller.ts +45 -0
- package/src/utils/match.ts +286 -0
- package/src/utils/options.ts +22 -0
- package/src/utils/walk.ts +136 -0
- package/types/assert.d.ts +18 -0
- package/types/async.d.ts +20 -0
- package/types/build.d.ts +56 -0
- package/types/files.d.ts +44 -0
- package/types/fork.d.ts +57 -0
- package/types/helpers.d.ts +49 -0
- package/types/index.d.ts +14 -0
- package/types/log/colors.d.ts +25 -0
- package/types/log/emit.d.ts +14 -0
- package/types/log/levels.d.ts +52 -0
- package/types/log/logger.d.ts +31 -0
- package/types/log/options.d.ts +40 -0
- package/types/log/report.d.ts +64 -0
- package/types/log/spinner.d.ts +2 -0
- package/types/log.d.ts +10 -0
- package/types/paths.d.ts +76 -0
- package/types/pipe.d.ts +152 -0
- package/types/plugs/copy.d.ts +27 -0
- package/types/plugs/coverage/analysis.d.ts +104 -0
- package/types/plugs/coverage/report.d.ts +53 -0
- package/types/plugs/coverage.d.ts +46 -0
- package/types/plugs/debug.d.ts +14 -0
- package/types/plugs/esbuild/bundle-locals.d.ts +6 -0
- package/types/plugs/esbuild/check-dependencies.d.ts +12 -0
- package/types/plugs/esbuild/fix-extensions.d.ts +29 -0
- package/types/plugs/esbuild.d.ts +24 -0
- package/types/plugs/eslint/runner.d.ts +22 -0
- package/types/plugs/exec.d.ts +90 -0
- package/types/plugs/filter.d.ts +23 -0
- package/types/plugs/mocha/reporter.d.ts +8 -0
- package/types/plugs/mocha/runner.d.ts +34 -0
- package/types/plugs/tsc/compiler.d.ts +24 -0
- package/types/plugs/tsc/options.d.ts +8 -0
- package/types/plugs/tsc/report.d.ts +5 -0
- package/types/plugs/tsc/runner.d.ts +13 -0
- package/types/plugs.d.ts +16 -0
- package/types/run.d.ts +89 -0
- package/types/task.d.ts +15 -0
- package/types/utils/asyncfs.d.ts +37 -0
- package/types/utils/caller.d.ts +7 -0
- package/types/utils/match.d.ts +216 -0
- package/types/utils/options.d.ts +15 -0
- package/types/utils/walk.d.ts +28 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
export interface MatchResult {
|
|
2
|
+
/** The glob that matched this `MatchResult` */
|
|
3
|
+
glob: string;
|
|
4
|
+
/** The regular expression that matched this `MatchResult` */
|
|
5
|
+
regex: RegExp;
|
|
6
|
+
/** The input string of this `MatchResult` */
|
|
7
|
+
input: string;
|
|
8
|
+
/** The input string of this `MatchResult` */
|
|
9
|
+
output: string;
|
|
10
|
+
/** The match result of this instance, if any */
|
|
11
|
+
match?: boolean | RegExpExecArray | null;
|
|
12
|
+
/** Whether the string matched or not */
|
|
13
|
+
isMatch: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface MatchOptions {
|
|
16
|
+
/**
|
|
17
|
+
* If set, then patterns without slashes will be matched against the basename
|
|
18
|
+
* of the path if it contains slashes.
|
|
19
|
+
*
|
|
20
|
+
* For example, `a?b` would match the path `/xyz/123/acb`, but not
|
|
21
|
+
* `/xyz/acb/123`.
|
|
22
|
+
*
|
|
23
|
+
* @defaultValue `false`
|
|
24
|
+
*/
|
|
25
|
+
basename?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Follow bash matching rules more strictly - disallows backslashes as escape
|
|
28
|
+
* characters, and treats single stars as globstars (`**`).
|
|
29
|
+
*
|
|
30
|
+
* @defaultValue `false`
|
|
31
|
+
*/
|
|
32
|
+
bash?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Return regex matches in `onIgnore(..)`, `onMatch(..)` and `onResult(..)`.
|
|
35
|
+
*
|
|
36
|
+
* @defaultValue `false`
|
|
37
|
+
*/
|
|
38
|
+
capture?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Allows glob to match any part of the given string(s).
|
|
41
|
+
*
|
|
42
|
+
* @defaultValue `false`
|
|
43
|
+
*/
|
|
44
|
+
contains?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Debug regular expressions when an error is thrown.
|
|
47
|
+
*
|
|
48
|
+
* @defaultValue `false`
|
|
49
|
+
*/
|
|
50
|
+
debug?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Enable dotfile matching.
|
|
53
|
+
*
|
|
54
|
+
* By default, dotfiles are ignored unless a `.` is explicitly defined in
|
|
55
|
+
* the pattern, or this option is `true`.
|
|
56
|
+
*
|
|
57
|
+
* @defaultValue `false`
|
|
58
|
+
*/
|
|
59
|
+
dot?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Custom function for expanding ranges in brace patterns, such as `{a..z}`.
|
|
62
|
+
*
|
|
63
|
+
* The function receives the range values as two arguments, and it must
|
|
64
|
+
* return a string to be used in the generated regex.
|
|
65
|
+
*
|
|
66
|
+
* It's recommended that returned strings be wrapped in parentheses.
|
|
67
|
+
*
|
|
68
|
+
* @defaultValue `undefined`
|
|
69
|
+
*/
|
|
70
|
+
expandRange?: (a: string, b: string) => string;
|
|
71
|
+
/**
|
|
72
|
+
* To speed up processing, full parsing is skipped for a handful common glob
|
|
73
|
+
* patterns.
|
|
74
|
+
*
|
|
75
|
+
* Disable this behavior by setting this option to `false`.
|
|
76
|
+
*
|
|
77
|
+
* @defaultValue `true`
|
|
78
|
+
*/
|
|
79
|
+
fastpaths?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Regex flags to use in the generated regex.
|
|
82
|
+
*
|
|
83
|
+
* If defined, the nocase option will be overridden.
|
|
84
|
+
*
|
|
85
|
+
* @defaultValue `undefined`
|
|
86
|
+
*/
|
|
87
|
+
flags?: string;
|
|
88
|
+
/**
|
|
89
|
+
* One or more glob patterns for excluding strings that should not be matched
|
|
90
|
+
* from the result.
|
|
91
|
+
*
|
|
92
|
+
* @defaultValue `undefined`
|
|
93
|
+
*/
|
|
94
|
+
ignore?: string | string[];
|
|
95
|
+
/**
|
|
96
|
+
* Retain quotes in the generated regular expressions, since quotes may also
|
|
97
|
+
* be used as an alternative to backslashes.
|
|
98
|
+
*
|
|
99
|
+
* @defaultValue `false`
|
|
100
|
+
*/
|
|
101
|
+
keepQuotes?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* When `true`, brackets in the glob pattern will be escaped so that only
|
|
104
|
+
* literal brackets will be matched.
|
|
105
|
+
*
|
|
106
|
+
* @defaultValue `false`
|
|
107
|
+
*/
|
|
108
|
+
literalBrackets?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Disable brace matching, so that `{a,b}` and `{1..3}` would be treated as
|
|
111
|
+
* literal characters.
|
|
112
|
+
*
|
|
113
|
+
* @defaultValue `false`
|
|
114
|
+
*/
|
|
115
|
+
nobrace?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Disable matching with regex brackets.
|
|
118
|
+
*
|
|
119
|
+
* @defaultValue `false`
|
|
120
|
+
*/
|
|
121
|
+
nobracket?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Make matching case-insensitive (equivalent to the regex `i` flag).
|
|
124
|
+
*
|
|
125
|
+
* Note that this option is overridden by the flags option.
|
|
126
|
+
*
|
|
127
|
+
* @defaultValue `false`
|
|
128
|
+
*/
|
|
129
|
+
nocase?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Disable support for matching with extglobs (like `+(a|b)`).
|
|
132
|
+
*
|
|
133
|
+
* @defaultValue `false`
|
|
134
|
+
*/
|
|
135
|
+
noextglob?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Disable support for matching nested directories with globstars (`**`).
|
|
138
|
+
*
|
|
139
|
+
* @defaultValue `false`
|
|
140
|
+
*/
|
|
141
|
+
noglobstar?: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Disable support for negating with leading `!`.
|
|
144
|
+
*
|
|
145
|
+
* @defaultValue `false`
|
|
146
|
+
*/
|
|
147
|
+
nonegate?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Disable support for regex quantifiers (like `a{1,2}`) and treat them as
|
|
150
|
+
* brace patterns to be expanded.
|
|
151
|
+
*
|
|
152
|
+
* @defaultValue `false`
|
|
153
|
+
*/
|
|
154
|
+
noquantifiers?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Function to be called on ignored items.
|
|
157
|
+
*
|
|
158
|
+
* @defaultValue `undefined`
|
|
159
|
+
*/
|
|
160
|
+
onIgnore?: (result: MatchResult) => void;
|
|
161
|
+
/**
|
|
162
|
+
* Function to be called on matched items.
|
|
163
|
+
*
|
|
164
|
+
* @defaultValue `undefined`
|
|
165
|
+
*/
|
|
166
|
+
onMatch?: (result: MatchResult) => void;
|
|
167
|
+
/**
|
|
168
|
+
* Function to be called on all items, regardless of whether or not they
|
|
169
|
+
* are matched or ignored.
|
|
170
|
+
*
|
|
171
|
+
* @defaultValue `undefined`
|
|
172
|
+
*/
|
|
173
|
+
onResult?: (result: MatchResult) => void;
|
|
174
|
+
/**
|
|
175
|
+
* Support POSIX character classes ("posix brackets").
|
|
176
|
+
*
|
|
177
|
+
* @defaultValue `false`
|
|
178
|
+
*/
|
|
179
|
+
posix?: boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Use regular expression rules for `+` (instead of matching literal `+`),
|
|
182
|
+
* and for stars that follow closing parentheses or brackets (as in `)*`
|
|
183
|
+
* and `]*`).
|
|
184
|
+
*
|
|
185
|
+
* @defaultValue `false`
|
|
186
|
+
*/
|
|
187
|
+
regex?: boolean;
|
|
188
|
+
/**
|
|
189
|
+
* Throw an error if brackets, braces, or parens are imbalanced.
|
|
190
|
+
*
|
|
191
|
+
* @defaultValue `false`
|
|
192
|
+
*/
|
|
193
|
+
strictBrackets?: boolean;
|
|
194
|
+
/**
|
|
195
|
+
* When true, picomatch won't match trailing slashes with single stars.
|
|
196
|
+
*
|
|
197
|
+
* @defaultValue `false`
|
|
198
|
+
*/
|
|
199
|
+
strictSlashes?: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* Remove backslashes preceding escaped characters in the glob pattern.
|
|
202
|
+
*
|
|
203
|
+
* By default, backslashes are retained.
|
|
204
|
+
*
|
|
205
|
+
* @defaultValue `false`
|
|
206
|
+
*/
|
|
207
|
+
unescape?: boolean;
|
|
208
|
+
}
|
|
209
|
+
/** A _function_ matching a string. */
|
|
210
|
+
export declare type Matcher = (string: string) => boolean;
|
|
211
|
+
/**
|
|
212
|
+
* Create a {@link Matcher} according to the globs and options specified.
|
|
213
|
+
*
|
|
214
|
+
* Remember that no globs here means an always-failing matcher.
|
|
215
|
+
*/
|
|
216
|
+
export declare function match(globs: readonly string[], options?: MatchOptions): Matcher;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare type ParsedOptions<Options> = {
|
|
2
|
+
params: string[];
|
|
3
|
+
options: Options;
|
|
4
|
+
};
|
|
5
|
+
export declare type ParsedOptionalOptions<Options> = {
|
|
6
|
+
params: string[];
|
|
7
|
+
options?: Options | undefined;
|
|
8
|
+
};
|
|
9
|
+
export declare type ParseOptions<Options> = string[] | [...string[], Options] | [Options];
|
|
10
|
+
/** Parse an array of at least one string, followed by an optional `Options` argument. */
|
|
11
|
+
export declare function parseOptions<Options>(args: ParseOptions<Options>): ParsedOptionalOptions<Options>;
|
|
12
|
+
/** Parse an array of at least one string, followed by an optional `Options` argument. */
|
|
13
|
+
export declare function parseOptions<Options>(args: ParseOptions<Options>, defaults?: undefined): ParsedOptionalOptions<Options>;
|
|
14
|
+
/** Parse an array of at least one string, followed by an optional `Options` argument, ensuring some defaults are present. */
|
|
15
|
+
export declare function parseOptions<Options, Defaults extends Options>(args: ParseOptions<Options>, defaults: Defaults): ParsedOptions<Options & Defaults>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AbsolutePath } from '../paths.js';
|
|
2
|
+
import { MatchOptions } from './match.js';
|
|
3
|
+
/** Specific options for walking a directory */
|
|
4
|
+
export interface WalkOptions extends MatchOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Whether symlinks should be followed or not.
|
|
7
|
+
*
|
|
8
|
+
* @defaultValue `true`
|
|
9
|
+
*/
|
|
10
|
+
followSymlinks?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* The maximum depth (in directory levels) to recurse into.
|
|
13
|
+
*
|
|
14
|
+
* @defaultValue `Infinity`
|
|
15
|
+
*/
|
|
16
|
+
maxDepth?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Whether to allow walking any `node_modules` directory or not.
|
|
19
|
+
*
|
|
20
|
+
* @defaultValue `false`
|
|
21
|
+
*/
|
|
22
|
+
allowNodeModules?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Walk the specified directory, returning an asynchronous iterator over all
|
|
26
|
+
* the _relative_ files found matching the specified globs and matching options.
|
|
27
|
+
*/
|
|
28
|
+
export declare function walk(directory: AbsolutePath, globs: string[], options?: WalkOptions): AsyncGenerator<string, void, void>;
|