[ENG-3833] handle object in is bool (#3974)

* handle object in is bool

* use if statements
This commit is contained in:
Khaleel Al-Adhami 2024-09-23 18:14:28 -07:00 committed by Masen Furer
parent 18576dc904
commit 1bb3e6f38c
No known key found for this signature in database
GPG Key ID: 2AE2BD5531FF94F4

View File

@ -805,7 +805,9 @@ export const useEventLoop = (
* @returns True if the value is truthy, false otherwise.
*/
export const isTrue = (val) => {
return Array.isArray(val) ? val.length > 0 : !!val;
if (Array.isArray(val)) return val.length > 0;
if (val === Object(val)) return Object.keys(val).length > 0;
return Boolean(val);
};
/**