Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
Use ternary operator in helpers methods
Browse files Browse the repository at this point in the history
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
  • Loading branch information
Jérôme Benoit committed May 2, 2022
1 parent a2d1c0f commit 7558b3a
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/utils/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,7 @@ export default class Utils {
}

public static isIterable<T>(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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 7558b3a

Please sign in to comment.