mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 01:17:50 +00:00
Bump to v4.0.0.
This commit is contained in:
17
internal/cloneSet.js
Normal file
17
internal/cloneSet.js
Normal file
@@ -0,0 +1,17 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user