mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
17 lines
389 B
JavaScript
17 lines
389 B
JavaScript
import addSetEntry from './_addSetEntry';
|
|
import arrayReduce from './_arrayReduce';
|
|
import setToArray from './_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);
|
|
}
|
|
|
|
export default cloneSet;
|