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

mapKeys-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
import {mapKeys} from 'rambda'
const obj = { a: 1, b: 2,}const changeKeyFn = (prop: string) => `${prop}_foo`
interface Output { a_foo: string, b_foo: string,}
describe('R.mapKeys', () => { it('happy', () => { const result = mapKeys<number, Output>(changeKeyFn, obj)
result // $ExpectType Output }) it('curried', () => { const result = mapKeys<number, Output>(changeKeyFn)(obj)
result // $ExpectType Output })})
rambda

Version Info

Tagged at
2 months ago