市场夺宝奇兵
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 lines
344 B

  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. }