mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
419 B
18 lines
419 B
9 years ago
|
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;
|