is-pure-object.js 312 B

123456789101112131415
  1. /**
  2. * Is pure object.
  3. *
  4. * @param {*} value
  5. * @returns {boolean}
  6. */
  7. export function isPureObject(value) {
  8. return Boolean(
  9. typeof value === 'object' &&
  10. value &&
  11. !Array.isArray(value) &&
  12. (!value.constructor ||
  13. (value.constructor && value.constructor.name === 'Object')),
  14. );
  15. }