|
|
@@ -7,7 +7,8 @@ export function getFilename(path: string | undefined) {
|
|
|
|
|
|
export function getDirectory(path: string | undefined) {
|
|
|
if (!path) return ""
|
|
|
- const parts = path.split("/")
|
|
|
+ const trimmed = path.replace(/[\/\\]+$/, "")
|
|
|
+ const parts = trimmed.split(/[\/\\]/)
|
|
|
return parts.slice(0, parts.length - 1).join("/") + "/"
|
|
|
}
|
|
|
|