deno.land / x / rambda@v9.1.1 / source / takeUntil.js

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
export function takeUntil(predicate, list){ const toReturn = [] let stopFlag = false let counter = -1
while (stopFlag === false && counter++ < list.length - 1){ if (predicate(list[ counter ])){ stopFlag = true } else { toReturn.push(list[ counter ]) } }
return toReturn}
rambda

Version Info

Tagged at
2 months ago