mirror of
https://github.com/bytedream/stream-bypass.git
synced 2025-05-09 20:25:14 +02:00
Fix lastPathSegment util
This commit is contained in:
parent
50f400b8b9
commit
8d575241fe
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user