We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61d518c commit 5481249Copy full SHA for 5481249
src/functions/typed/is-object.ts
@@ -3,7 +3,6 @@
3
*
4
* (c) 2024 Feedzai
5
*/
6
-import { isNil } from ".";
7
8
/**
9
* Checks if `value` is the language type of `Object`.
@@ -25,10 +24,13 @@ import { isNil } from ".";
25
24
* // false
26
27
export function isObject(value: unknown): value is object {
28
- if (isNil(value)) {
+ if (value === null) {
+ return false;
29
+ }
30
+
31
+ if (typeof value !== "object") {
32
return false;
33
}
34
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
35
return (value as any).constructor === Object;
36
0 commit comments