|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 2 weeks ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
253 bytes
|
| Rev | Line | |
|---|
| [9af201e] | 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.