source:
node_modules/ramda/src/internal/_dropLastWhile.js
Last change on this file was d24f17c, checked in by , 15 months ago | |
---|---|
|
|
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.