You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## .add({pattern: string, mark?: string}): this since 7.0.0
128
128
129
129
-**pattern**`string | Ignore` An ignore pattern string, or the `Ignore` instance
130
130
-**patterns**`Array<string | Ignore>` Array of ignore patterns.
@@ -277,11 +277,14 @@ Creates a filter function which could filter an array of paths with `Array.proto
277
277
278
278
Returns `function(path)` the filter function.
279
279
280
-
## .test(pathname: Pathname) since 5.0.0
280
+
## .test(pathname: Pathname): TestResult
281
+
282
+
> New in 5.0.0
281
283
282
284
Returns `TestResult`
283
285
284
286
```ts
287
+
// Since 5.0.0
285
288
interfaceTestResult {
286
289
ignored:boolean
287
290
// true if the `pathname` is finally unignored by some negative pattern
@@ -290,6 +293,7 @@ interface TestResult {
290
293
rule?:IgnoreRule
291
294
}
292
295
296
+
// Since 7.0.0
293
297
interfaceIgnoreRule {
294
298
// The original pattern
295
299
pattern:string
@@ -304,11 +308,13 @@ interface IgnoreRule {
304
308
-`{ignored: false, unignored: true}`: the `pathname` is unignored
305
309
-`{ignored: false, unignored: false}`: the `pathname` is never matched by any ignore rules.
306
310
307
-
## .checkIgnore(pattern) since 7.0.0
311
+
## .checkIgnore(target: string): TestResult
312
+
313
+
> new in 7.0.0
308
314
309
-
> new in 6.1.0
315
+
Debugs gitignore / exclude files, which is equivalent to `git check-ignore -v`. Usually this method is used for other packages to implement the function of `git check-ignore -v` upon `node-ignore`
310
316
311
-
Debug gitignore / exclude files, which is equivalent to `git check-ignore -v`. Usually this method is used for other packages to implement the function of `git check-ignore -v` upon `node-ignore`
0 commit comments