securityos/node_modules/react-redux/lib/utils/isPlainObject.js

21 lines
540 B
JavaScript
Raw Permalink Normal View History

2024-09-06 15:32:35 +00:00
"use strict";
exports.__esModule = true;
exports["default"] = isPlainObject;
/**
* @param {any} obj The object to inspect.
* @returns {boolean} True if the argument appears to be a plain object.
*/
function isPlainObject(obj) {
if (typeof obj !== 'object' || obj === null) return false;
var proto = Object.getPrototypeOf(obj);
if (proto === null) return true;
var baseProto = proto;
while (Object.getPrototypeOf(baseProto) !== null) {
baseProto = Object.getPrototypeOf(baseProto);
}
return proto === baseProto;
}