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

Function IsRootedDiskPath

internal/tspath/path.go:37–39  ·  view source on GitHub ↗

Determines whether a path is an absolute disk path (e.g. starts with `/`, or a dos path like `c:`, `c:\` or `c:/`).

(path string)

Source from the content-addressed store, hash-verified

35// Determines whether a path is an absolute disk path (e.g. starts with `/`, or a dos path
36// like `c:`, `c:\` or `c:/`).
37func IsRootedDiskPath(path string) bool {
38 return GetEncodedRootLength(path) > 0
39}
40
41// Determines whether a path consists only of a path root.
42func IsDiskPathRoot(path string) bool {

Calls 1

GetEncodedRootLengthFunction · 0.85

Tested by 4

TestUntitledPathHandlingFunction · 0.74
TestIsRootedDiskPathFunction · 0.68