mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-29 21:19:48 +00:00
parent
80772e5ac2
commit
faa848cfb1
3 changed files with 4 additions and 8 deletions
|
|
@ -1,7 +1,7 @@
|
|||
export function getFilename(path: string | undefined) {
|
||||
if (!path) return ""
|
||||
const trimmed = path.replace(/[\/]+$/, "")
|
||||
const parts = trimmed.split("/")
|
||||
const trimmed = path.replace(/[\/\\]+$/, "")
|
||||
const parts = trimmed.split(/[\/\\]/)
|
||||
return parts[parts.length - 1] ?? ""
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue