1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-09-24 03:18:28 +02:00
upscayl/common/get-file-name.ts
2024-04-25 09:18:48 +05:30

6 lines
184 B
TypeScript

export default function getFilenameFromPath(path: string) {
if (!path) return "";
const separator = path.includes("/") ? "/" : "\\";
return path.split(separator).slice(-1)[0];
}