Comparing version 5.3.1 to 5.3.2
24
index.js
@@ -82,13 +82,22 @@ // A simple implementation of make-array | ||
// (a ) -> (a) | ||
// (a ) -> (a) | ||
// (a \ ) -> (a ) | ||
/\\?\s+$/, | ||
match => match.indexOf('\\') === 0 | ||
? SPACE | ||
: EMPTY | ||
/((?:\\\\)*?)(\\?\s+)$/, | ||
(_, m1, m2) => m1 + ( | ||
m2.indexOf('\\') === 0 | ||
? SPACE | ||
: EMPTY | ||
) | ||
], | ||
// replace (\ ) with ' ' | ||
// (\ ) -> ' ' | ||
// (\\ ) -> '\\ ' | ||
// (\\\ ) -> '\\ ' | ||
[ | ||
/\\\s/g, | ||
() => SPACE | ||
/(\\+?)\s/g, | ||
(_, m1) => { | ||
const {length} = m1 | ||
return m1.slice(0, length - length % 2) + SPACE | ||
} | ||
], | ||
@@ -321,3 +330,4 @@ | ||
source = REPLACERS.reduce( | ||
(prev, current) => prev.replace(current[0], current[1].bind(pattern)), | ||
(prev, [matcher, replacer]) => | ||
prev.replace(matcher, replacer.bind(pattern)), | ||
pattern | ||
@@ -324,0 +334,0 @@ ) |
@@ -9,2 +9,8 @@ "use strict"; | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } | ||
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
// A simple implementation of make-array | ||
@@ -86,9 +92,14 @@ function makeArray(subject) { | ||
// (a ) -> (a) | ||
// (a ) -> (a) | ||
// (a \ ) -> (a ) | ||
/\\?\s+$/, function (match) { | ||
return match.indexOf('\\') === 0 ? SPACE : EMPTY; | ||
/((?:\\\\)*?)(\\?\s+)$/, function (_, m1, m2) { | ||
return m1 + (m2.indexOf('\\') === 0 ? SPACE : EMPTY); | ||
}], | ||
// replace (\ ) with ' ' | ||
[/\\\s/g, function () { | ||
return SPACE; | ||
// (\ ) -> ' ' | ||
// (\\ ) -> '\\ ' | ||
// (\\\ ) -> '\\ ' | ||
[/(\\+?)\s/g, function (_, m1) { | ||
var length = m1.length; | ||
return m1.slice(0, length - length % 2) + SPACE; | ||
}], | ||
@@ -282,4 +293,7 @@ // Escape metacharacters | ||
if (!source) { | ||
source = REPLACERS.reduce(function (prev, current) { | ||
return prev.replace(current[0], current[1].bind(pattern)); | ||
source = REPLACERS.reduce(function (prev, _ref) { | ||
var _ref2 = _slicedToArray(_ref, 2), | ||
matcher = _ref2[0], | ||
replacer = _ref2[1]; | ||
return prev.replace(matcher, replacer.bind(pattern)); | ||
}, pattern); | ||
@@ -359,9 +373,9 @@ regexCache[pattern] = source; | ||
function Ignore() { | ||
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
_ref$ignorecase = _ref.ignorecase, | ||
ignorecase = _ref$ignorecase === void 0 ? true : _ref$ignorecase, | ||
_ref$ignoreCase = _ref.ignoreCase, | ||
ignoreCase = _ref$ignoreCase === void 0 ? ignorecase : _ref$ignoreCase, | ||
_ref$allowRelativePat = _ref.allowRelativePaths, | ||
allowRelativePaths = _ref$allowRelativePat === void 0 ? false : _ref$allowRelativePat; | ||
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
_ref3$ignorecase = _ref3.ignorecase, | ||
ignorecase = _ref3$ignorecase === void 0 ? true : _ref3$ignorecase, | ||
_ref3$ignoreCase = _ref3.ignoreCase, | ||
ignoreCase = _ref3$ignoreCase === void 0 ? ignorecase : _ref3$ignoreCase, | ||
_ref3$allowRelativePa = _ref3.allowRelativePaths, | ||
allowRelativePaths = _ref3$allowRelativePa === void 0 ? false : _ref3$allowRelativePa; | ||
_classCallCheck(this, Ignore); | ||
@@ -368,0 +382,0 @@ define(this, KEY_IGNORE, true); |
{ | ||
"name": "ignore", | ||
"version": "5.3.1", | ||
"version": "5.3.2", | ||
"description": "Ignore is a manager and filter for .gitignore rules, the one used by eslint, gitbook and many others.", | ||
@@ -20,2 +20,3 @@ "files": [ | ||
"test:ignore": "npm run tap test/ignore.js", | ||
"test:ignore:only": "IGNORE_ONLY_IGNORES=1 npm run tap test/ignore.js", | ||
"test:others": "npm run tap test/others.js", | ||
@@ -65,6 +66,6 @@ "test:cases": "npm run tap test/*.js -- --coverage", | ||
"pre-suf": "^1.1.1", | ||
"rimraf": "^5.0.1", | ||
"rimraf": "^6.0.1", | ||
"spawn-sync": "^2.0.0", | ||
"tap": "^16.3.9", | ||
"tmp": "0.2.1", | ||
"tmp": "0.2.3", | ||
"typescript": "^5.1.6" | ||
@@ -71,0 +72,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
53630
1108