micromatch
Advanced tools
Comparing version 3.1.4 to 3.1.5
@@ -741,7 +741,2 @@ 'use strict'; | ||
if (pattern.slice(0, 2) === './') { | ||
pattern = pattern.slice(2); | ||
} | ||
pattern = utils.combineDuplicates(pattern, '\\*\\*\\/|\\/\\*\\*'); | ||
var ast = snapdragon.parse(pattern, options); | ||
@@ -748,0 +743,0 @@ utils.define(ast, 'snapdragon', snapdragon); |
@@ -123,18 +123,15 @@ 'use strict'; | ||
/** | ||
* Combines duplicate characters in the provided string. | ||
* @param {String} `str` | ||
* @returns {String} | ||
* Returns true if the given `str` has special characters | ||
*/ | ||
utils.combineDuplicates = function(str, val) { | ||
var re = new RegExp('(' + val + ')(?=(?:' + val + ')*\\1)', 'g'); | ||
return str.replace(re, ''); | ||
utils.hasSpecialChars = function(str) { | ||
return /(?:(?:(^|\/)[!.])|[*?+()|\[\]{}]|[+@]\()/.test(str); | ||
}; | ||
/** | ||
* Returns true if the given `str` has special characters | ||
* Escape regex characters in the given string | ||
*/ | ||
utils.hasSpecialChars = function(str) { | ||
return /(?:(?:(^|\/)[!.])|[*?+()|\[\]{}]|[+@]\()/.test(str); | ||
utils.escapeRegex = function(str) { | ||
return str.replace(/[-[\]{}()^$|*+?.\\\/\s]/g, '\\$&'); | ||
}; | ||
@@ -141,0 +138,0 @@ |
{ | ||
"name": "micromatch", | ||
"description": "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.", | ||
"version": "3.1.4", | ||
"version": "3.1.5", | ||
"homepage": "https://github.com/micromatch/micromatch", | ||
@@ -6,0 +6,0 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", |
84745
1162