Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ignore

Package Overview
Dependencies
Maintainers
1
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ignore - npm Package Compare versions

Comparing version 3.3.3 to 3.3.4

2

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc