Files
lodash/internal/cloneSet.js
John-David Dalton 0646bacd86 Bump to v4.0.0.
2016-01-12 08:28:18 -08:00

18 lines
416 B
JavaScript

var addSetEntry = require('./addSetEntry'),
arrayReduce = require('./arrayReduce'),
setToArray = require('./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);
}
module.exports = cloneSet;