MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / isWithinPathOrEqual

Function isWithinPathOrEqual

src/shared/utils/fs.ts:102–105  ·  view source on GitHub ↗
(file: string, folder: string)

Source from the content-addressed store, hash-verified

100}
101
102export function isWithinPathOrEqual(file: string, folder: string) {
103 const relative = path.relative(folder.toLowerCase(), file.toLowerCase());
104 return relative === "" || (!!relative && !relative.startsWith("..") && !path.isAbsolute(relative));
105}
106
107export function findCommonAncestorFolder(folderPaths: string[]): string | undefined {
108 if (!folderPaths.length)

Callers 8

util.test.tsFile · 0.90
expectStatusFunction · 0.90
codeLensIsValidForFileFunction · 0.90
isExcludedPathMethod · 0.90
getOverridesMethod · 0.90
findProjectFoldersFunction · 0.85

Calls

no outgoing calls

Tested by 1

expectStatusFunction · 0.72