Comparing version 3.3.3 to 3.3.4
{ | ||
"name": "ignore", | ||
"version": "3.3.3", | ||
"version": "3.3.4", | ||
"description": "Ignore is a manager and filter for .gitignore rules.", | ||
@@ -5,0 +5,0 @@ "main": "./ignore.js", |
@@ -110,4 +110,4 @@ <table><thead> | ||
- pattern `String|Ignore` An ignore pattern string, or the `Ignore` instance | ||
- patterns `Array.<pattern>` Array of ignore patterns. | ||
- **pattern** `String|Ignore` An ignore pattern string, or the `Ignore` instance | ||
- **patterns** `Array.<pattern>` Array of ignore patterns. | ||
@@ -152,2 +152,12 @@ Adds a rule or several rules to the current manager. | ||
### .ignores(pathname) | ||
> new in 3.2.0 | ||
Returns `Boolean` whether `pathname` should be ignored. | ||
```js | ||
ig.ignores('.abc/a.js') // true | ||
``` | ||
### .filter(paths) | ||
@@ -157,7 +167,24 @@ | ||
- paths `Array.<path>` The array of paths to be filtered. | ||
- **paths** `Array.<path>` The array of `pathname`s to be filtered. | ||
*NOTICE* that each `path` here should be a relative path to the root of your repository. Suppose the dir structure is: | ||
**NOTICE** that: | ||
- `pathname` should be a string that have been `path.join()`ed, or the return value of `path.relative()` to the current directory. | ||
```js | ||
// WRONG | ||
ig.ignores('./abc') | ||
// Right | ||
ig.ignores('abc') | ||
// Right | ||
ig.ignores(path.join('./abc')) // path.join('./abc') -> 'abc' | ||
``` | ||
- In other words, each `pathname` here should be a relative path to the directory of the git ignore rules. | ||
Suppose the dir structure is: | ||
``` | ||
/path/to/your/repo | ||
@@ -207,12 +234,2 @@ |-- a | ||
### .ignores(pathname) | ||
> new in 3.2.0 | ||
Returns `Boolean` whether `pathname` should be ignored. | ||
```js | ||
ig.ignores('.abc/a.js') // true | ||
``` | ||
**** | ||
@@ -219,0 +236,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22093
257