提交 d8368f1e 编写于 作者: B Benjamin Pasero

glob - faster check for trivia2

上级 56b71bd9
......@@ -288,7 +288,9 @@ export function match(arg1: string | IExpression, path: string, siblings?: strin
// common pattern: **/some.txt just need basename check
if (testWithCache(arg1, trivia2, T2_CACHE)) {
return paths.basename(path) === arg1.substr(3); // '**/'.length === 3
const base = arg1.substr(3); // '**/'.length === 3
return path === base || strings.endsWith(path, `/${base}`) || strings.endsWith(path, `\\${base}`);
}
// repetition of common patterns (see above) {**/*.txt,**/*.png}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册