source:
frontend/node_modules/@jridgewell/trace-mapping/src/strip-filename.ts
| Last change on this file was 9af201e, checked in by , 2 weeks ago | |
|---|---|
|
|
| File size: 253 bytes | |
| Line | |
|---|---|
| 1 | /** |
| 2 | * Removes everything after the last "/", but leaves the slash. |
| 3 | */ |
| 4 | export default function stripFilename(path: string | undefined | null): string { |
| 5 | if (!path) return ''; |
| 6 | const index = path.lastIndexOf('/'); |
| 7 | return path.slice(0, index + 1); |
| 8 | } |
Note:
See TracBrowser
for help on using the repository browser.
