aboutsummaryrefslogtreecommitdiffstats
path: root/src/jsUtils.ts
diff options
context:
space:
mode:
authorLibravatar Vijay A <vraravam@users.noreply.github.com>2024-04-19 09:02:56 +0530
committerLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2024-04-19 03:52:01 +0000
commit03a12413d632a2a1613091e44c52ce46b4adc5b8 (patch)
tree0086e0f98a644df91644b9cdde5ca1515188113a /src/jsUtils.ts
parent6.7.3-nightly.13 [skip ci] (diff)
downloadferdium-app-03a12413d632a2a1613091e44c52ce46b4adc5b8.tar.gz
ferdium-app-03a12413d632a2a1613091e44c52ce46b4adc5b8.tar.zst
ferdium-app-03a12413d632a2a1613091e44c52ce46b4adc5b8.zip
Minor refactoring to move repeated code into utility class
Diffstat (limited to 'src/jsUtils.ts')
-rw-r--r--src/jsUtils.ts6
1 files changed, 5 insertions, 1 deletions
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) =>
9export const cleanseJSObject = (data?: any | null) => 9export const cleanseJSObject = (data?: any | null) =>
10 JSON.parse(JSON.stringify(data)); 10 JSON.parse(JSON.stringify(data));
11 11
12export const isEscKeyPress = (key: string) => key === 'Escape'; 12export const isArrowUpKeyPress = (key: string) => key === 'ArrowUp';
13export const isArrowDownKeyPress = (key: string) => key === 'ArrowDown';
14export const isEnterKeyPress = (key: string) => key === 'Enter';
15export const isEscapeKeyPress = (key: string) => key === 'Escape';
16export const isShiftKeyPress = (key: string) => key === 'Shift';
13 17
14export const safeParseInt = (text?: string | number | null) => { 18export const safeParseInt = (text?: string | number | null) => {
15 if (text === undefined || text === null) { 19 if (text === undefined || text === null) {