Files
lodash/internal/lazyClone.js
John-David Dalton 5379c1996b Bump to v3.0.0.
2015-01-25 13:44:01 -08:00

29 lines
759 B
JavaScript

import LazyWrapper from './LazyWrapper';
import arrayCopy from './arrayCopy';
/**
* Creates a clone of the lazy wrapper object.
*
* @private
* @name clone
* @memberOf LazyWrapper
* @returns {Object} Returns the cloned `LazyWrapper` object.
*/
function lazyClone() {
var actions = this.actions,
iteratees = this.iteratees,
views = this.views,
result = new LazyWrapper(this.wrapped);
result.actions = actions ? arrayCopy(actions) : null;
result.dir = this.dir;
result.dropCount = this.dropCount;
result.filtered = this.filtered;
result.iteratees = iteratees ? arrayCopy(iteratees) : null;
result.takeCount = this.takeCount;
result.views = views ? arrayCopy(views) : null;
return result;
}
export default lazyClone;