Files
lodash/internal/cloneSet.js
John-David Dalton 8c26e6fd4c Bump to v4.0.0.
2016-01-13 01:10:19 -08:00

17 lines
412 B
JavaScript

define(['./addSetEntry', './arrayReduce', './setToArray'], function(addSetEntry, arrayReduce, setToArray) {
/**
* Creates a clone of `set`.
*
* @private
* @param {Object} set The set to clone.
* @returns {Object} Returns the cloned set.
*/
function cloneSet(set) {
var Ctor = set.constructor;
return arrayReduce(setToArray(set), addSetEntry, new Ctor);
}
return cloneSet;
});