mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 17:47:49 +00:00
Bump to v3.2.0.
This commit is contained in:
18
internal/wrapperClone.js
Normal file
18
internal/wrapperClone.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import LazyWrapper from './LazyWrapper';
|
||||
import LodashWrapper from './LodashWrapper';
|
||||
import arrayCopy from './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__));
|
||||
}
|
||||
|
||||
export default wrapperClone;
|
||||
Reference in New Issue
Block a user