blob: 2c889800e196e1728b8f4e6c50dd686b5f874376 (
plain) (
blame)
1
2
3
4
5
6
7
8
|
/**
* Removes everything after the last "/", but leaves the slash.
*/
export default function stripFilename(path: string | undefined | null): string {
if (!path) return '';
const index = path.lastIndexOf('/');
return path.slice(0, index + 1);
}
|