site/node_modules/is-plain-obj/index.js

9 lines
344 B
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
export default function isPlainObject(value) {
if (typeof value !== 'object' || value === null) {
return false;
}
const prototype = Object.getPrototypeOf(value);
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
}