elearning/Frontend-Learner/node_modules/@jridgewell/trace-mapping/src/strip-filename.ts

9 lines
253 B
TypeScript
Raw Normal View History

2026-01-13 10:46:40 +07:00
/**
* 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);
}