add folder browsing support (#315)

This commit is contained in:
jeffvli
2025-12-02 21:30:44 -08:00
parent 355257104d
commit 917bf91583
53 changed files with 2382 additions and 299 deletions
+1
View File
@@ -8,3 +8,4 @@ export * from './rgb-to-rgba';
export * from './sentence-case';
export * from './set-local-storage-setttings';
export * from './title-case';
export * from './truncate-middle';
+12
View File
@@ -0,0 +1,12 @@
export const truncateMiddle = (text: string, maxLength: number): string => {
if (text.length <= maxLength) {
return text;
}
const ellipsis = '…';
const halfLength = Math.floor((maxLength - ellipsis.length) / 2);
const start = text.substring(0, halfLength);
const end = text.substring(text.length - halfLength);
return `${start}${ellipsis}${end}`;
};