Files
lodash/internal/cloneSet.js
John-David Dalton 54e7baecc3 Bump to v4.0.0.
2016-01-12 00:17:29 -08:00

18 lines
405 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) {
var Ctor = set.constructor;
return arrayReduce(setToArray(set), addSetEntry, new Ctor);
}
export default cloneSet;