Files
lodash/_customOmitClone.js
John-David Dalton b93c3b1ee8 Bump to v4.17.3.
2016-12-21 15:55:54 -06:00

17 lines
503 B
JavaScript

var isPlainObject = require('./isPlainObject');
/**
* Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
* objects.
*
* @private
* @param {*} value The value to inspect.
* @param {string} key The key of the property to inspect.
* @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
*/
function customOmitClone(value, key) {
return (key !== undefined && isPlainObject(value)) ? undefined : value;
}
module.exports = customOmitClone;