mirror of
https://github.com/upscayl/upscayl.git
synced 2024-11-13 18:30:54 +01:00
Fix windows separator
This commit is contained in:
parent
e695e62875
commit
0dd5b029d0
@ -1,8 +1,5 @@
|
|||||||
export default function getFilenameFromPath(
|
export default function getFilenameFromPath(path: string) {
|
||||||
path: string,
|
|
||||||
withExtension: boolean = true,
|
|
||||||
) {
|
|
||||||
if (!path) return "";
|
if (!path) return "";
|
||||||
if (withExtension) return path.split("/").slice(-1)[0];
|
const separator = path.includes("/") ? "/" : "\\";
|
||||||
return path.split("/").slice(-1)[0].split(".").slice(0, -1).join(".");
|
return path.split(separator).slice(-1)[0];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user