mirror of
https://github.com/bytedream/stream-bypass.git
synced 2025-06-27 10:30:31 +02:00
7 lines
170 B
TypeScript
7 lines
170 B
TypeScript
export function lastPathSegment(path: string): string {
|
|
while (path.endsWith('/')) {
|
|
path = path.slice(0, -1);
|
|
}
|
|
return path.substring(path.lastIndexOf('/') + 1);
|
|
}
|