Last change
on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
491 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | var LazyWrapper = require('./_LazyWrapper');
|
---|
| 2 |
|
---|
| 3 | /**
|
---|
| 4 | * Reverses the direction of lazy iteration.
|
---|
| 5 | *
|
---|
| 6 | * @private
|
---|
| 7 | * @name reverse
|
---|
| 8 | * @memberOf LazyWrapper
|
---|
| 9 | * @returns {Object} Returns the new reversed `LazyWrapper` object.
|
---|
| 10 | */
|
---|
| 11 | function lazyReverse() {
|
---|
| 12 | if (this.__filtered__) {
|
---|
| 13 | var result = new LazyWrapper(this);
|
---|
| 14 | result.__dir__ = -1;
|
---|
| 15 | result.__filtered__ = true;
|
---|
| 16 | } else {
|
---|
| 17 | result = this.clone();
|
---|
| 18 | result.__dir__ *= -1;
|
---|
| 19 | }
|
---|
| 20 | return result;
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | module.exports = lazyReverse;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.