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

Function SplitPath

internal/vfs/internal/internal.go:30–36  ·  view source on GitHub ↗
(p string)

Source from the content-addressed store, hash-verified

28}
29
30func SplitPath(p string) (rootName, rest string) {
31 p = tspath.NormalizePath(p)
32 l := RootLength(p)
33 rootName, rest = p[:l], p[l:]
34 rest = tspath.RemoveTrailingDirectorySeparator(rest)
35 return rootName, rest
36}
37
38func (vfs *Common) RootAndPath(path string) (fsys fs.FS, rootName string, rest string) {
39 rootName, rest = SplitPath(path)

Callers 2

RealpathMethod · 0.92
RootAndPathMethod · 0.85

Calls 3

NormalizePathFunction · 0.92
RootLengthFunction · 0.85

Tested by

no test coverage detected