mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
513 B
19 lines
513 B
10 years ago
|
var LazyWrapper = require('./LazyWrapper'),
|
||
|
LodashWrapper = require('./LodashWrapper'),
|
||
|
arrayCopy = require('./arrayCopy');
|
||
|
|
||
|
/**
|
||
|
* Creates a clone of `wrapper`.
|
||
|
*
|
||
|
* @private
|
||
|
* @param {Object} wrapper The wrapper to clone.
|
||
|
* @returns {Object} Returns the cloned wrapper.
|
||
|
*/
|
||
|
function wrapperClone(wrapper) {
|
||
|
return wrapper instanceof LazyWrapper
|
||
|
? wrapper.clone()
|
||
|
: new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
|
||
|
}
|
||
|
|
||
|
module.exports = wrapperClone;
|