summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/strings.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/utils/strings.ts b/src/utils/strings.ts
index df2f781..2fd4c76 100644
--- a/src/utils/strings.ts
+++ b/src/utils/strings.ts
@@ -1 +1,3 @@
export const ellipsize = (str: string, len: number) => (str.length > len ? `${str.slice(0, len - 1)}…` : str);
+
+export const basename = (path: string) => path.slice(path.lastIndexOf("/") + 1, path.lastIndexOf("."));