本文整理汇总了TypeScript中vs/platform/files/common/files.isEqualOrParent函数的典型用法代码示例。如果您正苦于以下问题:TypeScript isEqualOrParent函数的具体用法?TypeScript isEqualOrParent怎么用?TypeScript isEqualOrParent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isEqualOrParent函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: contains
private contains(resource: URI): boolean {
if (resource) {
return isEqualOrParent(resource.fsPath, this._resource.fsPath, !isLinux /* ignorecase */);
}
return false;
}
示例2: isInsideWorkspace
public isInsideWorkspace(resource: URI): boolean {
if (resource && this.workspace) {
return isEqualOrParent(resource.fsPath, this.workspace.resource.fsPath, !isLinux /* ignorecase */);
}
return false;
}
示例3: test
test('isEqualOrParent (ignorecase)', function () {
// same assertions apply as with isEqual()
testIsEqual(isEqualOrParent);
if (isWindows) {
assert(isEqualOrParent('c:\\some\\path', 'c:\\', true));
assert(isEqualOrParent('c:\\some\\path', 'c:\\some', true));
assert(isEqualOrParent('c:\\some\\path', 'c:\\some\\', true));
assert(isEqualOrParent('c:\\someöäü\\path', 'c:\\someöäü', true));
assert(isEqualOrParent('c:\\someöäü\\path', 'c:\\someöäü\\', true));
assert(isEqualOrParent('c:\\foo\\bar\\test.ts', 'c:\\foo\\bar', true));
assert(isEqualOrParent('c:\\foo\\bar\\test.ts', 'c:\\foo\\bar\\', true));
assert(isEqualOrParent('c:\\some\\path', 'c:\\some\\path', true));
assert(isEqualOrParent('c:\\foo\\bar\\test.ts', 'c:\\foo\\bar\\test.ts', true));
assert(isEqualOrParent('c:\\some\\path', 'C:\\', true));
assert(isEqualOrParent('c:\\some\\path', 'c:\\SOME', true));
assert(isEqualOrParent('c:\\some\\path', 'c:\\SOME\\', true));
assert(!isEqualOrParent('c:\\some\\path', 'd:\\', true));
assert(!isEqualOrParent('c:\\some\\path', 'd:\\some\\path', true));
assert(!isEqualOrParent('c:\\foo\\bar\\test.ts', 'c:\\foo\\barr', true));
assert(!isEqualOrParent('c:\\foo\\bar\\test.ts', 'c:\\foo\\bar\\test', true));
assert(!isEqualOrParent('c:\\foo\\bar\\test.ts', 'c:\\foo\\bar\\test.', true));
assert(!isEqualOrParent('c:\\foo\\bar\\test.ts', 'c:\\foo\\BAR\\test.', true));
}
if (isMacintosh || isLinux) {
assert(isEqualOrParent('/some/path', '/', true));
assert(isEqualOrParent('/some/path', '/some', true));
assert(isEqualOrParent('/some/path', '/some/', true));
assert(isEqualOrParent('/someöäü/path', '/someöäü', true));
assert(isEqualOrParent('/someöäü/path', '/someöäü/', true));
assert(isEqualOrParent('/foo/bar/test.ts', '/foo/bar', true));
assert(isEqualOrParent('/foo/bar/test.ts', '/foo/bar/', true));
assert(isEqualOrParent('/some/path', '/some/path', true));
assert(isEqualOrParent('/some/path', '/SOME', true));
assert(isEqualOrParent('/some/path', '/SOME/', true));
assert(isEqualOrParent('/someöäü/path', '/SOMEÖÄÜ', true));
assert(isEqualOrParent('/someöäü/path', '/SOMEÖÄÜ/', true));
assert(!isEqualOrParent('/foo/bar/test.ts', '/foo/barr', true));
assert(!isEqualOrParent('/foo/bar/test.ts', '/foo/bar/test', true));
assert(!isEqualOrParent('foo/bar/test.ts', 'foo/bar/test.', true));
assert(!isEqualOrParent('foo/bar/test.ts', 'foo/BAR/test.', true));
}
});
示例4: isEqualOrParent
const containers = windows.filter(window => typeof window.openedWorkspacePath === 'string' && isEqualOrParent(filePath, window.openedWorkspacePath, !platform.isLinux /* ignorecase */));