| @@ 16925-16942 (lines=18) @@ | ||
| 16922 | return this.filter(negate(getIteratee(predicate))); |
|
| 16923 | }; |
|
| 16924 | ||
| 16925 | LazyWrapper.prototype.slice = function(start, end) { |
|
| 16926 | start = toInteger(start); |
|
| 16927 | ||
| 16928 | var result = this; |
|
| 16929 | if (result.__filtered__ && (start > 0 || end < 0)) { |
|
| 16930 | return new LazyWrapper(result); |
|
| 16931 | } |
|
| 16932 | if (start < 0) { |
|
| 16933 | result = result.takeRight(-start); |
|
| 16934 | } else if (start) { |
|
| 16935 | result = result.drop(start); |
|
| 16936 | } |
|
| 16937 | if (end !== undefined) { |
|
| 16938 | end = toInteger(end); |
|
| 16939 | result = end < 0 ? result.dropRight(-end) : result.take(end - start); |
|
| 16940 | } |
|
| 16941 | return result; |
|
| 16942 | }; |
|
| 16943 | ||
| 16944 | LazyWrapper.prototype.takeRightWhile = function(predicate) { |
|
| 16945 | return this.reverse().takeWhile(predicate).reverse(); |
|
| @@ 12188-12205 (lines=18) @@ | ||
| 12185 | }); |
|
| 12186 | }; |
|
| 12187 | ||
| 12188 | LazyWrapper.prototype.slice = function(start, end) { |
|
| 12189 | start = start == null ? 0 : (+start || 0); |
|
| 12190 | ||
| 12191 | var result = this; |
|
| 12192 | if (result.__filtered__ && (start > 0 || end < 0)) { |
|
| 12193 | return new LazyWrapper(result); |
|
| 12194 | } |
|
| 12195 | if (start < 0) { |
|
| 12196 | result = result.takeRight(-start); |
|
| 12197 | } else if (start) { |
|
| 12198 | result = result.drop(start); |
|
| 12199 | } |
|
| 12200 | if (end !== undefined) { |
|
| 12201 | end = (+end || 0); |
|
| 12202 | result = end < 0 ? result.dropRight(-end) : result.take(end - start); |
|
| 12203 | } |
|
| 12204 | return result; |
|
| 12205 | }; |
|
| 12206 | ||
| 12207 | LazyWrapper.prototype.takeRightWhile = function(predicate, thisArg) { |
|
| 12208 | return this.reverse().takeWhile(predicate, thisArg).reverse(); |
|
| @@ 515-532 (lines=18) @@ | ||
| 512 | return this.filter(negate(baseIteratee(predicate))); |
|
| 513 | }; |
|
| 514 | ||
| 515 | LazyWrapper.prototype.slice = function(start, end) { |
|
| 516 | start = toInteger(start); |
|
| 517 | ||
| 518 | var result = this; |
|
| 519 | if (result.__filtered__ && (start > 0 || end < 0)) { |
|
| 520 | return new LazyWrapper(result); |
|
| 521 | } |
|
| 522 | if (start < 0) { |
|
| 523 | result = result.takeRight(-start); |
|
| 524 | } else if (start) { |
|
| 525 | result = result.drop(start); |
|
| 526 | } |
|
| 527 | if (end !== undefined) { |
|
| 528 | end = toInteger(end); |
|
| 529 | result = end < 0 ? result.dropRight(-end) : result.take(end - start); |
|
| 530 | } |
|
| 531 | return result; |
|
| 532 | }; |
|
| 533 | ||
| 534 | LazyWrapper.prototype.takeRightWhile = function(predicate) { |
|
| 535 | return this.reverse().takeWhile(predicate).reverse(); |
|