mirror of
https://github.com/aljazceru/opencode.git
synced 2026-02-06 16:44:31 +01:00
feat: fuzzy file open
This commit is contained in:
@@ -3,6 +3,11 @@ export function getFilename(path: string) {
|
||||
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]
|
||||
|
||||
Reference in New Issue
Block a user