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