This commit is contained in:
2025-04-04 00:01:21 +02:00
parent 8d575241fe
commit 8a13dea681
4 changed files with 16 additions and 12 deletions

View File

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