minimatch
Advanced tools
Comparing version 3.0.0 to 3.0.2
@@ -238,3 +238,3 @@ module.exports = minimatch | ||
if (typeof pattern === 'undefined') { | ||
throw new Error('undefined pattern') | ||
throw new TypeError('undefined pattern') | ||
} | ||
@@ -265,2 +265,6 @@ | ||
function parse (pattern, isSub) { | ||
if (pattern.length > 1024 * 64) { | ||
throw new TypeError('pattern is too long') | ||
} | ||
var options = this.options | ||
@@ -523,3 +527,3 @@ | ||
// maybe some even number of \, then maybe 1 \, followed by a | | ||
tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { | ||
tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { | ||
if (!$2) { | ||
@@ -621,3 +625,11 @@ // the | isn't already escaped, so escape it. | ||
var flags = options.nocase ? 'i' : '' | ||
var regExp = new RegExp('^' + re + '$', flags) | ||
try { | ||
var regExp = new RegExp('^' + re + '$', flags) | ||
} catch (er) { | ||
// If it was an invalid regular expression, then it can't match | ||
// anything. This trick looks for a character after the end of | ||
// the string, which is of course impossible, except in multi-line | ||
// mode, but it's not a /m regex. | ||
return new RegExp('$.') | ||
} | ||
@@ -624,0 +636,0 @@ regExp._glob = pattern |
@@ -5,3 +5,3 @@ { | ||
"description": "a glob matcher in javascript", | ||
"version": "3.0.0", | ||
"version": "3.0.2", | ||
"repository": { | ||
@@ -24,3 +24,3 @@ "type": "git", | ||
"standard": "^3.7.2", | ||
"tap": "^1.2.0" | ||
"tap": "^5.6.0" | ||
}, | ||
@@ -27,0 +27,0 @@ "license": "ISC", |
@@ -5,3 +5,3 @@ # minimatch | ||
[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) | ||
[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) | ||
@@ -41,3 +41,3 @@ | ||
Create a minimatch object by instanting the `minimatch.Minimatch` class. | ||
Create a minimatch object by instantiating the `minimatch.Minimatch` class. | ||
@@ -87,9 +87,2 @@ ```javascript | ||
## Functions | ||
The top-level exported function has a `cache` property, which is an LRU | ||
cache set to store 100 items. So, calling these methods repeatedly | ||
with the same pattern and options will use the same Minimatch object, | ||
saving the cost of parsing it multiple times. | ||
### minimatch(path, pattern, options) | ||
@@ -96,0 +89,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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
32971
782
0
210