1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-28 01:10:52 +01:00
upscayl/common/get-file-name.ts

6 lines
184 B
TypeScript
Raw Normal View History

2024-04-25 05:48:48 +02:00
export default function getFilenameFromPath(path: string) {
if (!path) return "";
2024-04-25 05:48:48 +02:00
const separator = path.includes("/") ? "/" : "\\";
return path.split(separator).slice(-1)[0];
}