diff options
author | Vijay A <vraravam@users.noreply.github.com> | 2023-05-28 13:48:21 +0530 |
---|---|---|
committer | Vijay A <vraravam@users.noreply.github.com> | 2023-05-28 13:48:21 +0530 |
commit | 99ca310c73024b51fed1f3077375eed7827f2c20 (patch) | |
tree | 2bd15986f448129a2291acba90ccc6bf68a233e0 /src/jsUtils.ts | |
parent | Disable in-app auto-updates for portable windows installation (fixes #1088) (... (diff) | |
download | ferdium-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.ts | 2 |
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 @@ | |||
1 | export const ifUndefined = <T>( | 1 | export 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 | ||
6 | export const convertToJSON = (data: string | any | undefined | null) => | 6 | export 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; |