🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
9 lines
253 B
TypeScript
Executable File
9 lines
253 B
TypeScript
Executable File
/**
|
|
* 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);
|
|
}
|