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

filterObject-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
import {filterObject} from 'rambda'
const obj = {a: 1, b: 2}
describe('R.filterObject', () => { it('happy', () => { const result = filterObject((val, prop, origin) => { val // $ExpectType number prop // $ExpectType string origin // $ExpectType Dictionary<number>
return val > 1 }, obj) result // $ExpectType Dictionary<number> }) it('curried version requires explicit type', () => { const result = filterObject<number>((val, prop, origin) => { val // $ExpectType number prop // $ExpectType string origin // $ExpectType Dictionary<number>
return val > 1 })(obj) result // $ExpectType Dictionary<number> })})
rambda

Version Info

Tagged at
2 months ago