From 03a12413d632a2a1613091e44c52ce46b4adc5b8 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Fri, 19 Apr 2024 09:02:56 +0530 Subject: Minor refactoring to move repeated code into utility class --- src/jsUtils.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/jsUtils.ts') diff --git a/src/jsUtils.ts b/src/jsUtils.ts index 72e8111e6..0befb8d56 100644 --- a/src/jsUtils.ts +++ b/src/jsUtils.ts @@ -9,7 +9,11 @@ export const convertToJSON = (data?: string | any | null) => export const cleanseJSObject = (data?: any | null) => JSON.parse(JSON.stringify(data)); -export const isEscKeyPress = (key: string) => key === 'Escape'; +export const isArrowUpKeyPress = (key: string) => key === 'ArrowUp'; +export const isArrowDownKeyPress = (key: string) => key === 'ArrowDown'; +export const isEnterKeyPress = (key: string) => key === 'Enter'; +export const isEscapeKeyPress = (key: string) => key === 'Escape'; +export const isShiftKeyPress = (key: string) => key === 'Shift'; export const safeParseInt = (text?: string | number | null) => { if (text === undefined || text === null) { -- cgit v1.2.3-54-g00ecf