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

produce-spec.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import {produce, pipe, add} from 'rambda'
describe('R.produce', () => { it('happy', () => { const result = produce( { a: pipe(add(2), add(3)), b: x => { x // $ExpectType number return {foo: x} }, }, 1 )
result.a // $ExpectType number result.b.foo // $ExpectType number }) it('curried require explicit types', () => { interface Output { a: number, b: {foo: number}, } const result = produce<number, Output>({ a: pipe(add(2), add(3)), b: x => { x // $ExpectType number return {foo: x} }, })(1)
result.a // $ExpectType number result.b.foo // $ExpectType number })})
rambda

Version Info

Tagged at
2 months ago