Files
lodash/_cloneSet.js
John-David Dalton 7da4c55415 Bump to v4.6.0.
2016-02-29 23:41:02 -08:00

17 lines
389 B
JavaScript

import addSetEntry from './_addSetEntry';
import arrayReduce from './_arrayReduce';
import setToArray from './_setToArray';
/**
* Creates a clone of `set`.
*
* @private
* @param {Object} set The set to clone.
* @returns {Object} Returns the cloned set.
*/
function cloneSet(set) {
return arrayReduce(setToArray(set), addSetEntry, new set.constructor);
}
export default cloneSet;