mirror of
https://github.com/bytedream/stream-bypass.git
synced 2025-05-09 20:25:14 +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);
|
|
}
|