feat: fuzzy file open
This commit is contained in:
parent
d3b6545e7c
commit
f589fc2327
4 changed files with 75 additions and 36 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue