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

renameProps-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
37
38
39
40
41
42
import {renameProps} from 'rambda'
const rules = { f: 'foo', b: 'bar',}const input = { f: 1, b: 2,}
describe('R.renameProps', () => { it('happy', () => { const result = renameProps(rules, input)
result // $ExpectType object }) it('curried', () => { const result = renameProps(rules)(input)
result // $ExpectType object })})
describe('R.renameProps - explicitly passed output type', () => { interface Output { foo: number, bar: number, }
it('happy', () => { const result = renameProps<Output>(rules, input)
result // $ExpectType Output }) it('curried', () => { const result = renameProps<Output>(rules)(input)
result // $ExpectType Output })})
rambda

Version Info

Tagged at
2 months ago