提交 81397b3d 编写于 作者: B Benjamin Pasero

Adding "base" to files.exclude breaks VS Code (fixes #36081)

上级 38e02739
......@@ -450,7 +450,7 @@ export function parse(arg1: string | IExpression | IRelativePattern, options: IG
}
// Glob with String
if (typeof arg1 === 'string' || (arg1 as IRelativePattern).base) {
if (typeof arg1 === 'string' || isRelativePattern(arg1)) {
const parsedPattern = parsePattern(arg1 as string | IRelativePattern, options);
if (parsedPattern === NULL) {
return FALSE;
......@@ -471,6 +471,12 @@ export function parse(arg1: string | IExpression | IRelativePattern, options: IG
return parsedExpression(<IExpression>arg1, options);
}
function isRelativePattern(obj: any): obj is IRelativePattern {
const rp = obj as IRelativePattern;
return typeof rp.base === 'string' && typeof rp.pattern === 'string';
}
/**
* Same as `parse`, but the ParsedExpression is guaranteed to return a Promise
*/
......
......@@ -933,4 +933,8 @@ suite('Glob', () => {
assert(!glob.match(p, '/DNXConsoleApp/foo/Program.cs'));
}
});
test('pattern with "base" does not explode - #36081', function () {
assert.ok(glob.match({ 'base': true }, 'base'));
});
});
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册