MCPcopy Create free account
hub / github.com/microsoft/typescript-go / getPathsRelativeToRootDirs

Function getPathsRelativeToRootDirs

internal/modulespecifiers/util.go:225–234  ·  view source on GitHub ↗
(path string, rootDirs []string, useCaseSensitiveFileNames bool)

Source from the content-addressed store, hash-verified

223}
224
225func getPathsRelativeToRootDirs(path string, rootDirs []string, useCaseSensitiveFileNames bool) []string {
226 var results []string
227 for _, rootDir := range rootDirs {
228 relativePath := getRelativePathIfInSameVolume(path, rootDir, useCaseSensitiveFileNames)
229 if !isPathRelativeToParent(relativePath) {
230 results = append(results, relativePath)
231 }
232 }
233 return results
234}
235
236func isPathRelativeToParent(path string) bool {
237 return strings.HasPrefix(path, "..")

Callers 1

Calls 3

isPathRelativeToParentFunction · 0.85
appendFunction · 0.50

Tested by

no test coverage detected