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

Function NormalizePath

internal/tspath/path.go:599–609  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

597}
598
599func NormalizePath(path string) string {
600 path = NormalizeSlashes(path)
601 if normalized, ok := simpleNormalizePath(path); ok {
602 return normalized
603 }
604 normalized := GetNormalizedAbsolutePath(path, "")
605 if normalized != "" && HasTrailingDirectorySeparator(path) {
606 normalized = EnsureTrailingDirectorySeparator(normalized)
607 }
608 return normalized
609}
610
611func GetCanonicalFileName(fileName string, useCaseSensitiveFileNames bool) string {
612 if useCaseSensitiveFileNames {

Callers 15

rootFromGlobFunction · 0.92
realPathMethod · 0.92
ParseNodeModuleFromPathFunction · 0.92
tryUpdateConfigStringFunction · 0.92
updateRelativePathMethod · 0.92

Calls 5

NormalizeSlashesFunction · 0.85
simpleNormalizePathFunction · 0.70

Tested by 4

TestSymlinkRealpathFunction · 0.74
BenchmarkRealpathFunction · 0.74
TestGetAccessibleEntriesFunction · 0.74
TestOSFunction · 0.74