deno.land / x / rambda@v9.1.1 / source / cond-spec.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import {cond, always, equals} from 'rambda'
describe('R.cond', () => { it('happy', () => { const fn = cond<number[], string>([ [equals(0), always('water freezes at 0°C')], [equals(100), always('water boils at 100°C')], [ () => true, function(temp) { temp // $ExpectType number return 'nothing special happens at ' + temp + '°C' }, ], ])
const result = fn(0) result // $ExpectType string })})
rambda

Version Info

Tagged at
2 months ago