Parses a path string into a Path object with structured parts.
Splits the path into components, identifying root, slashes, and segments. Consecutive slashes are collapsed into single separators.
Path string to parse
Path object with structured components
const path = splitPath('/home/user/docs');// Path with parts: [Root, 'home', Slash, 'user', Slash, 'docs']const relative = splitPath('../config/app.json');// Path with parts: [Up, Slash, 'config', Slash, 'app.json'] Copy
const path = splitPath('/home/user/docs');// Path with parts: [Root, 'home', Slash, 'user', Slash, 'docs']const relative = splitPath('../config/app.json');// Path with parts: [Up, Slash, 'config', Slash, 'app.json']
Parses a path string into a Path object with structured parts.
Splits the path into components, identifying root, slashes, and segments. Consecutive slashes are collapsed into single separators.