diff --git a/src/utils/isPlainObject.ts b/src/utils/isPlainObject.ts index 9d1956328a..fc7ac3ab5e 100644 --- a/src/utils/isPlainObject.ts +++ b/src/utils/isPlainObject.ts @@ -3,12 +3,9 @@ * @returns True if the argument appears to be a plain object. */ export default function isPlainObject(obj: any): boolean { - if (typeof obj !== 'object' || obj === null) return false - - let proto = obj - while (Object.getPrototypeOf(proto) !== null) { - proto = Object.getPrototypeOf(proto) - } - - return Object.getPrototypeOf(obj) === proto + return ( + typeof value === 'object' && + value !== null && + Object.getPrototypeOf(Object.getPrototypeOf(value) || {}) === null + ) }