* Creates a clone of `set`. * * @private * @param {Object} set The set to clone. * @param {Function} cloneFunc The function to clone values. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned set.
(set, isDeep, cloneFunc)
| 52326 | * @returns {Object} Returns the cloned set. |
| 52327 | */ |
| 52328 | function cloneSet(set, isDeep, cloneFunc) { |
| 52329 | var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set); |
| 52330 | return arrayReduce(array, addSetEntry, new set.constructor()); |
| 52331 | } |
| 52332 | |
| 52333 | module.exports = cloneSet; |
| 52334 |
no test coverage detected