mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-19 08:09:51 +00:00
14 lines
360 B
TypeScript
14 lines
360 B
TypeScript
export function getFilename(path: string) {
|
|
const parts = path.split("/")
|
|
return parts[parts.length - 1]
|
|
}
|
|
|
|
export function getDirectory(path: string) {
|
|
const parts = path.split("/")
|
|
return parts.slice(0, parts.length - 1).join("/")
|
|
}
|
|
|
|
export function getFileExtension(path: string) {
|
|
const parts = path.split(".")
|
|
return parts[parts.length - 1]
|
|
}
|