aboutsummaryrefslogtreecommitdiffstats
path: root/src/jsUtils.ts
diff options
context:
space:
mode:
authorLibravatar Vijay A <vraravam@users.noreply.github.com>2023-05-28 13:48:21 +0530
committerLibravatar Vijay A <vraravam@users.noreply.github.com>2023-05-28 13:48:21 +0530
commit99ca310c73024b51fed1f3077375eed7827f2c20 (patch)
tree2bd15986f448129a2291acba90ccc6bf68a233e0 /src/jsUtils.ts
parentDisable in-app auto-updates for portable windows installation (fixes #1088) (... (diff)
downloadferdium-app-99ca310c73024b51fed1f3077375eed7827f2c20.tar.gz
ferdium-app-99ca310c73024b51fed1f3077375eed7827f2c20.tar.zst
ferdium-app-99ca310c73024b51fed1f3077375eed7827f2c20.zip
Fix issues reported by sonarqube linter
Diffstat (limited to 'src/jsUtils.ts')
-rw-r--r--src/jsUtils.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/jsUtils.ts b/src/jsUtils.ts
index 0cc83bb91..47473a538 100644
--- a/src/jsUtils.ts
+++ b/src/jsUtils.ts
@@ -1,7 +1,7 @@
1export const ifUndefined = <T>( 1export const ifUndefined = <T>(
2 source: undefined | null | T, 2 source: undefined | null | T,
3 defaultValue: T, 3 defaultValue: T,
4): T => (source !== undefined && source !== null ? source : defaultValue); 4): T => source ?? defaultValue;
5 5
6export const convertToJSON = (data: string | any | undefined | null) => 6export const convertToJSON = (data: string | any | undefined | null) =>
7 data && typeof data === 'string' && data.length > 0 ? JSON.parse(data) : data; 7 data && typeof data === 'string' && data.length > 0 ? JSON.parse(data) : data;