From ff99d738bfc6b934e8d1dfaa506f0ad88e0a7511 Mon Sep 17 00:00:00 2001 From: Samantha Kellow Date: Sun, 20 Aug 2023 20:06:02 +0100 Subject: [PATCH] Fix getKeyByValue --- lib/helpers/actions.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/helpers/actions.tsx b/lib/helpers/actions.tsx index f188ef3d3..b1074e942 100644 --- a/lib/helpers/actions.tsx +++ b/lib/helpers/actions.tsx @@ -2,10 +2,10 @@ export function copyText(text: string) { navigator.clipboard.writeText(text); } -export function capitalizeFirstLetter(string) { +export function capitalizeFirstLetter(string: string) { return string.charAt(0).toUpperCase() + string.slice(1); } -export function getKeyByValue(object, value) { - return Object.keys(object).find(key => object[key] === value); +export function getKeyByValue(object: O, value: O[keyof O]) { + return Object.keys(object).find(key => object[key as keyof O] === value); }