From e7c1c7ede090a82e0c2aa8408449b2e52afd3642 Mon Sep 17 00:00:00 2001 From: Luchankin Konstantin Date: Sat, 1 Apr 2023 16:23:14 +0500 Subject: [PATCH] isPlainObject early return upd --- src/utils/isPlainObject.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/isPlainObject.ts b/src/utils/isPlainObject.ts index 9cfa8a9573..2767112254 100644 --- a/src/utils/isPlainObject.ts +++ b/src/utils/isPlainObject.ts @@ -3,7 +3,7 @@ * @returns True if the argument appears to be a plain object. */ export default function isPlainObject(obj: any): boolean { - if (!obj) return false + if (typeof obj !== 'object' || obj === null) return false const proto = obj.__proto__ return !proto || !Object.getPrototypeOf(proto)