mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 16:47:49 +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 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user