_customOmitClone.js 475 B

1234567891011121314151617
  1. var isPlainObject = require('./isPlainObject');
  2. /**
  3. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  4. * objects.
  5. *
  6. * @private
  7. * @param {*} value The value to inspect.
  8. * @param {string} key The key of the property to inspect.
  9. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  10. */
  11. function customOmitClone(value) {
  12. return isPlainObject(value) ? undefined : value;
  13. }
  14. module.exports = customOmitClone;