Skip to content

Commit 6a06a87

Browse files
committed
README.md: update
1 parent 5d278de commit 6a06a87

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ ig.filter(['.abc\\a.js', '.abc\\d\\e.js'])
124124

125125
## .add(pattern: string | Ignore): this
126126
## .add(patterns: Array<string | Ignore>): this
127-
## .add({pattern: string, mark?: string}): this
127+
## .add({pattern: string, mark?: string}): this since 7.0.0
128128

129129
- **pattern** `string | Ignore` An ignore pattern string, or the `Ignore` instance
130130
- **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
277277
278278
Returns `function(path)` the filter function.
279279
280-
## .test(pathname: Pathname) since 5.0.0
280+
## .test(pathname: Pathname): TestResult
281+
282+
> New in 5.0.0
281283
282284
Returns `TestResult`
283285
284286
```ts
287+
// Since 5.0.0
285288
interface TestResult {
286289
ignored: boolean
287290
// true if the `pathname` is finally unignored by some negative pattern
@@ -290,6 +293,7 @@ interface TestResult {
290293
rule?: IgnoreRule
291294
}
292295

296+
// Since 7.0.0
293297
interface IgnoreRule {
294298
// The original pattern
295299
pattern: string
@@ -304,11 +308,13 @@ interface IgnoreRule {
304308
- `{ignored: false, unignored: true}`: the `pathname` is unignored
305309
- `{ignored: false, unignored: false}`: the `pathname` is never matched by any ignore rules.
306310

307-
## .checkIgnore(pattern) since 7.0.0
311+
## .checkIgnore(target: string): TestResult
312+
313+
> new in 7.0.0
308314
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`
310316

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`
317+
- **target** `string` the target to test.
312318

313319
Returns `TestResult`
314320

0 commit comments

Comments
 (0)