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