remove wildcards from start of patterns
This commit is contained in:
parent
7a5b140f92
commit
9ab7df5f47
@ -76,8 +76,9 @@ export function regexify(val: any): RegExp {
|
||||
// normalise path separators
|
||||
val = slash(val);
|
||||
|
||||
// remove relative separator if present
|
||||
if (startsWith(val, "./")) val = val.slice(2);
|
||||
// remove starting wildcards or relative separator if present
|
||||
if (startsWith(val, "./") || startsWith(val, "*/")) val = val.slice(2);
|
||||
if (startsWith(val, "**/")) val = val.slice(3);
|
||||
|
||||
var regex = minimatch.makeRe(val, { nocase: true });
|
||||
return new RegExp(regex.source.slice(1, -1), "i");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user