Skip to content

Commit 5481249

Browse files
author
João Dias
committed
fix(isObject): removed isNil and used native verification
1 parent 61d518c commit 5481249

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/functions/typed/is-object.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
*
44
* (c) 2024 Feedzai
55
*/
6-
import { isNil } from ".";
76

87
/**
98
* Checks if `value` is the language type of `Object`.
@@ -25,10 +24,13 @@ import { isNil } from ".";
2524
* // false
2625
*/
2726
export function isObject(value: unknown): value is object {
28-
if (isNil(value)) {
27+
if (value === null) {
28+
return false;
29+
}
30+
31+
if (typeof value !== "object") {
2932
return false;
3033
}
3134

32-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3335
return (value as any).constructor === Object;
3436
}

0 commit comments

Comments
 (0)