index.js 344 B

12345678
  1. export default function isPlainObject(value) {
  2. if (typeof value !== 'object' || value === null) {
  3. return false;
  4. }
  5. const prototype = Object.getPrototypeOf(value);
  6. return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
  7. }