feat: basic directory navigation

This commit is contained in:
2025-09-17 00:04:12 +00:00
parent c7fb40e8eb
commit 44ce32fd84
17 changed files with 456 additions and 47 deletions

View File

@@ -4,6 +4,15 @@ export function baseName(path: string): string {
return path.split(PATH_SEPARATOR).pop() ?? ""
}
export function isPathAbsolute(path: string): boolean {
return path.startsWith(PATH_SEPARATOR)
}
export function joinPath(...paths: string[]): string {
return paths.join(PATH_SEPARATOR)
}
export function splitPath(path: string): string[] {
const parts = path.split(PATH_SEPARATOR)
return isPathAbsolute(path) ? parts.slice(1) : parts
}