main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
237 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | var slice =
|
---|
| 2 | /*#__PURE__*/
|
---|
| 3 | require("../slice.js");
|
---|
| 4 |
|
---|
| 5 | function dropLastWhile(pred, xs) {
|
---|
| 6 | var idx = xs.length - 1;
|
---|
| 7 |
|
---|
| 8 | while (idx >= 0 && pred(xs[idx])) {
|
---|
| 9 | idx -= 1;
|
---|
| 10 | }
|
---|
| 11 |
|
---|
| 12 | return slice(0, idx + 1, xs);
|
---|
| 13 | }
|
---|
| 14 |
|
---|
| 15 | module.exports = dropLastWhile; |
---|
Note:
See
TracBrowser
for help on using the repository browser.