remove wildcards from start of patterns

This commit is contained in:
Sebastian McKenzie 2015-05-15 17:42:10 +01:00
parent 7a5b140f92
commit 9ab7df5f47

View File

@ -76,8 +76,9 @@ export function regexify(val: any): RegExp {
// normalise path separators // normalise path separators
val = slash(val); val = slash(val);
// remove relative separator if present // remove starting wildcards or relative separator if present
if (startsWith(val, "./")) val = val.slice(2); if (startsWith(val, "./") || startsWith(val, "*/")) val = val.slice(2);
if (startsWith(val, "**/")) val = val.slice(3);
var regex = minimatch.makeRe(val, { nocase: true }); var regex = minimatch.makeRe(val, { nocase: true });
return new RegExp(regex.source.slice(1, -1), "i"); return new RegExp(regex.source.slice(1, -1), "i");