From 7558b3a6127e4c0541737e24a05c43a006d603c9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 2 May 2022 12:49:38 +0200 Subject: [PATCH] Use ternary operator in helpers methods MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/utils/Utils.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/utils/Utils.ts b/src/utils/Utils.ts index 074b1073..5035efdb 100644 --- a/src/utils/Utils.ts +++ b/src/utils/Utils.ts @@ -161,10 +161,7 @@ export default class Utils { } public static isIterable(obj: T): boolean { - if (obj) { - return typeof obj[Symbol.iterator] === 'function'; - } - return false; + return obj ? typeof obj[Symbol.iterator] === 'function' : false; } public static isString(value: unknown): boolean { @@ -180,11 +177,8 @@ export default class Utils { } public static isNullOrUndefined(value: unknown): boolean { - // eslint-disable-next-line no-eq-null, eqeqeq - if (value == null) { - return true; - } - return false; + // eslint-disable-next-line eqeqeq, no-eq-null + return value == null ? true : false; } public static isEmptyArray(object: unknown): boolean { -- 2.34.1