isPlainObject.js 470 B

1234567891011121314151617
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. Object.defineProperty(exports, "default", {
  6. enumerable: true,
  7. get: function() {
  8. return isPlainObject;
  9. }
  10. });
  11. function isPlainObject(value) {
  12. if (Object.prototype.toString.call(value) !== "[object Object]") {
  13. return false;
  14. }
  15. const prototype = Object.getPrototypeOf(value);
  16. return prototype === null || Object.getPrototypeOf(prototype) === null;
  17. }