diff --git a/src/lib/util/extract.ts b/src/lib/util/extract.ts index d1f2990..6ebb4c7 100644 --- a/src/lib/util/extract.ts +++ b/src/lib/util/extract.ts @@ -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); }