mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 08:07:50 +00:00
25 lines
514 B
JavaScript
25 lines
514 B
JavaScript
define(['./LazyWrapper'], function(LazyWrapper) {
|
|
|
|
/**
|
|
* Reverses the direction of lazy iteration.
|
|
*
|
|
* @private
|
|
* @name reverse
|
|
* @memberOf LazyWrapper
|
|
* @returns {Object} Returns the new reversed `LazyWrapper` object.
|
|
*/
|
|
function lazyReverse() {
|
|
if (this.filtered) {
|
|
var result = new LazyWrapper(this);
|
|
result.dir = -1;
|
|
result.filtered = true;
|
|
} else {
|
|
result = this.clone();
|
|
result.dir *= -1;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
return lazyReverse;
|
|
});
|