UNPKG

481 BJavaScriptView Raw
1const not = async (x) => {
2 var operand = await x
3 return !operand
4 }
5
6const identity = x => x
7
8// predicates
9const isEven = x => x % 2 === 0
10const isOdd = x => !isEven(x)
11const isGreaterThan = x => y => y > x ? y : 0
12const digitize = x => x ? 1 : 0
13
14const modulus = val => x => x % val
15
16const select = property => x => x[property]
17
18export {
19 isEven,
20 modulus,
21 isOdd,
22 isGreaterThan,
23 identity,
24 not,
25 digitize,
26 select
27}