UNPKG

463 BJavaScriptView Raw
1function keys(x) {
2 return x[0];
3}
4function values(x) {
5 return x[1];
6}
7function* entries(x) {
8 var vi = values(x)[Symbol.iterator]();
9 for (var k of keys(x))
10 yield [k, vi.next().value];
11}
12function search(x, ft) {
13 for (var [k, v] of x)
14 if (ft(v, k, x))
15 return k;
16}
17function scanUntil(x, ft) {
18 return search(x, ft);
19}
20function scanUntil$1(x, ft) {
21 return scanUntil(entries(x), ft);
22}
23export default scanUntil$1;