mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 08:57:49 +00:00
24 lines
469 B
JavaScript
24 lines
469 B
JavaScript
import LazyWrapper from './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;
|
|
}
|
|
|
|
export default lazyReverse;
|