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.
24 lines
491 B
24 lines
491 B
5 years ago
|
var LazyWrapper = require('./_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;
|
||
|
}
|
||
|
|
||
|
module.exports = lazyReverse;
|