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

Function GetRelativePathFromDirectory

internal/tspath/path.go:773–779  ·  view source on GitHub ↗
(fromDirectory string, to string, options ComparePathsOptions)

Source from the content-addressed store, hash-verified

771}
772
773func GetRelativePathFromDirectory(fromDirectory string, to string, options ComparePathsOptions) string {
774 if (GetRootLength(fromDirectory) > 0) != (GetRootLength(to) > 0) {
775 panic("paths must either both be absolute or both be relative")
776 }
777 pathComponents := GetPathComponentsRelativeTo(fromDirectory, to, options)
778 return GetPathFromPathComponents(pathComponents)
779}
780
781func GetRelativePathFromFile(from string, to string, options ComparePathsOptions) string {
782 return EnsurePathIsNonModuleName(GetRelativePathFromDirectory(GetDirectoryPath(from), to, options))

Calls 4

GetRootLengthFunction · 0.85
panicFunction · 0.85

Tested by

no test coverage detected