Socket
Socket
Sign inDemoInstall

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 2.2.13 to 2.2.14

3

package.json
{
"name": "ignore",
"version": "2.2.13",
"version": "2.2.14",
"description": "Ignore is a manager and filter for .gitignore rules.",

@@ -17,2 +17,3 @@ "main": "index.js",

"gitignore",
"npmignore",
"rules",

@@ -19,0 +20,0 @@ "manager",

# ignore [![NPM version](https://badge.fury.io/js/ignore.png)](http://badge.fury.io/js/ignore) [![Build Status](https://travis-ci.org/kaelzhang/node-ignore.png?branch=master)](https://travis-ci.org/kaelzhang/node-ignore) [![Dependency Status](https://gemnasium.com/kaelzhang/node-ignore.png)](https://gemnasium.com/kaelzhang/node-ignore)
`ignore` is a manager and filter according to the .gitignore [spec](http://git-scm.com/docs/gitignore).
`ignore` is a manager and filter which implemented in pure JavaScript according to the .gitignore [spec](http://git-scm.com/docs/gitignore).

@@ -5,0 +5,0 @@ ## Installation

@@ -185,89 +185,73 @@ 'use strict';

// description patterns paths expect
// [
// 'leading hash: will treat leading # as comments',
// ['#abc'],
// ['#abc'],
// ['#abc']
// ],
// [
// '\\#',
// ['\\#abc'],
// ['#abc'],
// []
// ],
// [
// 'could filter paths',
// [
// 'abc',
// '!abc/b'
// ],
// [
// 'abc/a.js',
// 'abc/b/b.js'
// ],
// [
// 'abc/b/b.js'
// ]
// ],
// [
// 'ignore.select',
// ignore.select([
// 'test/fixtures/.aignore',
// 'test/fixtures/.fakeignore'
// ]),
// [
// 'abc/a.js',
// 'abc/b/b.js',
// '#e',
// '#f'
// ],
// ['abc/b/b.js', '#e']
// ],
// [
// 'should excape metacharacters of regular expressions',
// [
// '*.js',
// '!\\*.js',
// '!a#b.js',
// '!?.js',
[
'leading hash: will treat leading # as comments',
['#abc'],
{
'#abc': 0
}
],
[
'\\#',
['\\#abc'],
{
'#abc': 1
}
],
[
'could filter paths',
[
'abc',
'!abc/b'
],
{
'abc/a.js': 1,
'abc/b/b.js': 0
}
],
[
'ignore.select',
ignore.select([
'test/fixtures/.aignore',
'test/fixtures/.fakeignore'
]), {
'abc/a.js': 1,
'abc/b/b.js': 0,
'#e': 0,
'#f': 1
}
],
[
'should excape metacharacters of regular expressions', [
'*.js',
'!\\*.js',
'!a#b.js',
'!?.js',
// // comments
// '#abc',
// comments
'#abc',
// '\\#abc'
// ],
// [
// '*.js',
// 'abc.js',
// 'a#b.js',
// 'abc',
// '#abc',
// '?.js'
// ],
// [
// '*.js',
// 'abc',
// 'a#b.js',
// '?.js'
// ]
// ],
'\\#abc'
], {
'*.js': 0,
'abc.js': 1,
'a#b.js': 0,
'abc': 0,
'#abc': 1,
'?.js': 0
}
],
// [
// 'issue #2: question mark should not break all things',
// 'test/fixtures/.ignore-issue-2',
// [
// '.project',
// // remain
// 'abc/.project',
// '.a.sw',
// '.a.sw?',
// 'thumbs.db'
// ],
// [
// 'abc/.project',
// '.a.sw',
// // 'thumbs.db'
// ]
// ],
[
'issue #2: question mark should not break all things',
'test/fixtures/.ignore-issue-2',
{
'.project': 1,
// remain
'abc/.project': 0,
'.a.sw': 0,
'.a.sw?': 1,
'thumbs.db': 1
}
],
[
'dir ended with "*"', [

@@ -333,2 +317,19 @@ 'abc/*'

}
],
[
'node modules: once', [
'node_modules/'
], {
'node_modules/gulp/node_modules/abc.md': 1,
'node_modules/gulp/node_modules/abc.json': 1
}
],
[
'node modules: twice', [
'node_modules/',
'node_modules/'
], {
'node_modules/gulp/node_modules/abc.md': 1,
'node_modules/gulp/node_modules/abc.json': 1
}
]

@@ -355,5 +356,8 @@ ];

var paths = Object.keys(paths_object);
var expected = paths.filter(function(p) {
return !paths_object[p];
});
it('.filter(): ' + description, function() {
var paths = Object.keys(paths_object);
var result = ignore()

@@ -363,21 +367,17 @@ .addPattern(patterns)

var expected = paths.filter(function(p) {
return !paths_object[p];
});
expect(result.sort()).to.deep.equal(expected.sort());
});
// it(".createFilter(): " + description, function(){
// var result = paths.filter(
// ignore()
// .addPattern(patterns)
// .createFilter(),
// // thisArg should be binded
// null
// );
it(".createFilter(): " + description, function(){
var result = paths.filter(
ignore()
.addPattern(patterns)
.createFilter(),
// thisArg should be binded
null
);
// expect(result.sort()).to.deep.equal(expected.sort());
// });
expect(result.sort()).to.deep.equal(expected.sort());
});
});
});

Sorry, the diff of this file is not supported yet

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