fix: isObject utils fn should return only boolean value (#4756)
### Description When `isObject` pass with param `null/undefined` it returns `null/undefined` We should strict return boolean value <!-- What's included in this PR? --> ### Drive-by changes ```diff export function isObject(item: any): boolean { - return item && typeof item === 'object' && !Array.isArray(item); + return !!item && typeof item === 'object' && !Array.isArray(item); } ``` <!-- Are there any minor or drive-by changes also included? --> ### Related issues <!-- - Fixes #[issue number here] --> ### Backward compatibility <!-- Are these changes backward compatible? Are there any infrastructure implications, e.g. changes that would prohibit deploying older commits using this infra tooling? Yes/No --> ### Testing Has updated with test `object.test.ts` <!-- What kind of testing have these changes undergone? None/Manual/Unit Tests -->pull/4751/head
parent
d5bdb2c28a
commit
a36fc5fb27
@ -0,0 +1,5 @@ |
||||
--- |
||||
'@hyperlane-xyz/utils': patch |
||||
--- |
||||
|
||||
fix: isObject utils fn should return only boolean value |
Loading…
Reference in new issue