diff options
Diffstat (limited to 'apps/web/lib')
| -rw-r--r-- | apps/web/lib/i18n/locales/en/translation.json | 10 | ||||
| -rw-r--r-- | apps/web/lib/utils.ts | 14 |
2 files changed, 23 insertions, 1 deletions
diff --git a/apps/web/lib/i18n/locales/en/translation.json b/apps/web/lib/i18n/locales/en/translation.json index ac08fa3f..1e9f8e4d 100644 --- a/apps/web/lib/i18n/locales/en/translation.json +++ b/apps/web/lib/i18n/locales/en/translation.json @@ -24,7 +24,13 @@ "screenshot": "Screenshot", "video": "Video", "archive": "Archive", - "home": "Home" + "home": "Home", + "bookmark_types": { + "title": "Bookmark Type", + "link": "Link", + "text": "Text", + "media": "Media" + } }, "layouts": { "masonry": "Masonry", @@ -218,6 +224,8 @@ "has_tag": "Has Tag", "does_not_have_tag": "Does Not Have Tag", "full_text_search": "Full Text Search", + "type_is": "Type is", + "type_is_not": "Type is not", "and": "And", "or": "Or" }, diff --git a/apps/web/lib/utils.ts b/apps/web/lib/utils.ts index 12207765..230c9eef 100644 --- a/apps/web/lib/utils.ts +++ b/apps/web/lib/utils.ts @@ -29,3 +29,17 @@ export function getOS() { } return os; } + +export function match<T extends string | number | symbol, U>( + val: T, + options: Record<T, U>, +) { + return options[val]; +} + +export function matchFunc<T extends string | number | symbol, U>( + val: T, + options: Record<T, () => U>, +) { + return options[val](); +} |
