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

mapObject-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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import {mapObject} from 'rambda'
describe('R.mapObject', () => { it('iterable with all three arguments', () => { const result = mapObject( (a, b, c) => { a // $ExpectType number b // $ExpectType string c // $ExpectType Dictionary<number> return `${a}` }, {a: 1, b: 2} ) result // $ExpectType Dictionary<string> }) it('iterable with property argument', () => { const result = mapObject( (a, b) => { a // $ExpectType number b // $ExpectType string return a + 2 }, {a: 1, b: 2} ) result // $ExpectType Dictionary<number> }) it('iterable with no property argument', () => { const result = mapObject( a => { a // $ExpectType number return `${a}` }, {a: 1, b: 2} ) result // $ExpectType Dictionary<string> }) it('curried requires explicit type', () => { const result = mapObject<number>((a, b, c) => { a // $ExpectType number b // $ExpectType string c // $ExpectType Dictionary<number> return a + 2 })({a: 1, b: 2}) result // $ExpectType Dictionary<number> }) it('curried requires explicit types', () => { const result = mapObject<number, string>((a, b, c) => { a // $ExpectType number b // $ExpectType string c // $ExpectType Dictionary<number> return `${a}` })({a: 1, b: 2}) result // $ExpectType Dictionary<string> })})
rambda

Version Info

Tagged at
2 months ago