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

Function ToPath

internal/tspath/path.go:687–695  ·  view source on GitHub ↗
(fileName string, basePath string, useCaseSensitiveFileNames bool)

Source from the content-addressed store, hash-verified

685}
686
687func ToPath(fileName string, basePath string, useCaseSensitiveFileNames bool) Path {
688 var nonCanonicalizedPath string
689 if IsRootedDiskPath(fileName) {
690 nonCanonicalizedPath = NormalizePath(fileName)
691 } else {
692 nonCanonicalizedPath = GetNormalizedAbsolutePath(fileName, basePath)
693 }
694 return Path(GetCanonicalFileName(nonCanonicalizedPath, useCaseSensitiveFileNames))
695}
696
697func RemoveTrailingDirectorySeparator(path string) string {
698 if HasTrailingDirectorySeparator(path) {

Callers 15

TestUntitledPathHandlingFunction · 0.92
PathMethod · 0.92
toPathMethod · 0.92
GetEachFileNameOfModuleFunction · 0.92
computeModuleSpecifiersFunction · 0.92
getLocalModuleSpecifierFunction · 0.92
toPathMethod · 0.92
toPathMethod · 0.92
toPathMethod · 0.92
NewProjectFunction · 0.92

Calls 5

IsRootedDiskPathFunction · 0.85
NormalizePathFunction · 0.85
GetCanonicalFileNameFunction · 0.85
PathTypeAlias · 0.70