deno.land / x / rambda@v9.1.1 / source / pluck-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
import {pluck} from 'rambda'
describe('R.pluck', () => { it('with object', () => { interface ListMember { a: number, b: string, } const input: ListMember[] = [ {a: 1, b: 'foo'}, {a: 2, b: 'bar'}, ] const resultA = pluck('a', input) const resultB = pluck('b')(input) resultA // $ExpectType number[] resultB // $ExpectType string[] })
it('with array', () => { const input = [ [1, 2], [3, 4], [5, 6], ] const result = pluck(0, input) const resultCurry = pluck(0)(input) result // $ExpectType number[] resultCurry // $ExpectType number[] })})
rambda

Version Info

Tagged at
2 months ago