Files
lodash/_cloneSet.js
John-David Dalton 7293d39642 Bump to v4.1.0.
2016-01-29 01:14:13 -08:00

17 lines
415 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;
});