🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

ignore

Package Overview
Dependencies
Maintainers
1
Versions
99
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
7.0.5
to
7.0.6
+11
-2
index.js

@@ -60,2 +60,11 @@ // A simple implementation of make-array

// > An optional `!` or `^` at the start of a class negates it, so that it
// > matches any character not in the set. (gitignore(5), fnmatch(3))
// The leading `^` has already been escaped to `\^` by the metacharacter
// escaper, so we strip the literal `!` or escaped `^` and emit a single
// regex `^` which is the JavaScript negation token.
const negateRange = range => range.startsWith('!') || range.startsWith('\\^')
? `^${range.slice(range[0] === '!' ? 1 : 2)}`
: range
// See fixtures #59

@@ -165,3 +174,3 @@ const cleanRangeBackSlash = slashes => {

// Notice that the '*'s have been replaced as '\\*'
/^\^*\\\*\\\*\\\//,
/^\^*(?:\\\*\\\*\\\/)+/,

@@ -277,3 +286,3 @@ // '**/foo' <-> 'foo'

// '[bar\\\\]'
? `[${sanitizeRange(range)}${endEscape}]`
? `[${negateRange(sanitizeRange(range))}${endEscape}]`
// Invalid range notaton

@@ -280,0 +289,0 @@ // '[bar\\]' -> '[bar\\\\]'

@@ -72,2 +72,11 @@ "use strict";

// > An optional `!` or `^` at the start of a class negates it, so that it
// > matches any character not in the set. (gitignore(5), fnmatch(3))
// The leading `^` has already been escaped to `\^` by the metacharacter
// escaper, so we strip the literal `!` or escaped `^` and emit a single
// regex `^` which is the JavaScript negation token.
var negateRange = function negateRange(range) {
return range.startsWith('!') || range.startsWith('\\^') ? "^".concat(range.slice(range[0] === '!' ? 1 : 2)) : range;
};
// See fixtures #59

@@ -156,3 +165,3 @@ var cleanRangeBackSlash = function cleanRangeBackSlash(slashes) {

// Notice that the '*'s have been replaced as '\\*'
/^\^*\\\*\\\*\\\//,
/^\^*(?:\\\*\\\*\\\/)+/,
// '**/foo' <-> 'foo'

@@ -253,3 +262,3 @@ function () {

// '[bar\\\\]'
? "[".concat(sanitizeRange(range)).concat(endEscape, "]") // Invalid range notaton
? "[".concat(negateRange(sanitizeRange(range))).concat(endEscape, "]") // Invalid range notaton
// '[bar\\]' -> '[bar\\\\]'

@@ -256,0 +265,0 @@ : '[]' : '[]';

+1
-1
{
"name": "ignore",
"version": "7.0.5",
"version": "7.0.6",
"description": "Ignore is a manager and filter for .gitignore rules, the one used by eslint, gitbook and many others.",

@@ -5,0 +5,0 @@ "types": "index.d.ts",