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.6 to 3.3.7

13

ignore.js

@@ -20,2 +20,5 @@ 'use strict';

var SLASH = '/';
var KEY_IGNORE = typeof Symbol !== 'undefined' ? Symbol.for('node-ignore')
/* istanbul ignore next */
: 'node-ignore';

@@ -27,2 +30,3 @@ var IgnoreBase = function () {

this._rules = [];
this[KEY_IGNORE] = true;
this._initCache();

@@ -69,3 +73,4 @@ }

value: function _addPattern(pattern) {
if (pattern instanceof IgnoreBase) {
// #32
if (pattern && pattern[KEY_IGNORE]) {
this._rules = this._rules.concat(pattern._rules);

@@ -159,8 +164,2 @@ this._added = true;

slices = path.split(SLASH);
// '/b/a.js' -> ['', 'b', 'a.js'] -> ['']
if (slices.length && !slices[0]) {
slices = slices.slice(1);
slices[0] = SLASH + slices[0];
}
}

@@ -167,0 +166,0 @@

{
"name": "ignore",
"version": "3.3.6",
"version": "3.3.7",
"description": "Ignore is a manager and filter for .gitignore rules.",

@@ -8,8 +8,9 @@ "main": "./ignore.js",

"ignore.js",
"index.d.ts",
"LICENSE-MIT"
"index.d.ts"
],
"scripts": {
"test": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec ./test/ignore.js && codecov",
"test-no-cov": "./node_modules/.bin/mocha --reporter spec ./test/ignore.js",
"prepublish": "npm run build",
"build": "babel -o ignore.js index.js",
"test": "npm run build && istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec ./test/ignore.js && codecov",
"test-no-cov": "npm run build && mocha --reporter spec ./test/ignore.js",
"cov-report": "istanbul report"

@@ -42,2 +43,4 @@ },

"devDependencies": {
"babel-cli": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"chai": "~1.7.2",

@@ -44,0 +47,0 @@ "codecov": "^1.0.1",

@@ -54,3 +54,4 @@ <table><thead>

- [Contributing](#contributing)
- [Related Packages](#related)
- Related Packages
- [`glob-gitignore`](https://www.npmjs.com/package/glob-gitignore) matches files using patterns and filters them according to gitignore rules.

@@ -177,2 +178,10 @@ ## Usage

// WRONG, for it will never happen.
// If the gitignore rule locates at the root directory,
// `'/abc'` should be changed to `'abc'`.
// ```
// path.relative('/', '/abc') -> 'abc'
// ```
ig.ignores('/abc')
// Right

@@ -256,5 +265,1 @@ ig.ignores('abc')

- [JanMattner](https://github.com/JanMattner) *Jan Mattner*
## Related
- [`glob-gitignore`](https://www.npmjs.com/package/glob-gitignore) matches files using patterns and filters them according to gitignore rules.
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