mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 23:37:49 +00:00
Bump to v4.1.0.
This commit is contained in:
17
_cloneSet.js
Normal file
17
_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