mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 07:17:50 +00:00
17 lines
400 B
JavaScript
17 lines
400 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) {
|
|
return arrayReduce(setToArray(set), addSetEntry, new set.constructor);
|
|
}
|
|
|
|
module.exports = cloneSet;
|