Fix lastPathSegment util

This commit is contained in:
bytedream 2025-04-04 00:00:38 +02:00
parent 50f400b8b9
commit 8d575241fe

View File

@ -1,3 +1,6 @@
export function lastPathSegment(path: string): string {
return path.substring(path.lastIndexOf('/'));
while (path.endsWith('/')) {
path = path.slice(0, -1);
}
return path.substring(path.lastIndexOf('/') + 1);
}