feat: new path util package
This commit is contained in:
9
packages/path/index.ts
Normal file
9
packages/path/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export const PATH_SEPARATOR = "/"
|
||||
|
||||
export function baseName(path: string): string {
|
||||
return path.split(PATH_SEPARATOR).pop() ?? ""
|
||||
}
|
||||
|
||||
export function joinPath(...paths: string[]): string {
|
||||
return paths.join(PATH_SEPARATOR)
|
||||
}
|
Reference in New Issue
Block a user