From 9fd26b472b18924ab11afcebace90329b0fe3abf Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sun, 12 Jan 2025 20:03:47 +0000 Subject: feat: Add ability to filter by bookmark type --- apps/web/lib/utils.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'apps/web/lib/utils.ts') 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( + val: T, + options: Record, +) { + return options[val]; +} + +export function matchFunc( + val: T, + options: Record U>, +) { + return options[val](); +} -- cgit v1.2.3-70-g09d2