deno.land / x / rambda@v9.1.1 / source / pluck-spec.ts
12345678910111213141516171819202122232425262728293031import {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[] })})
Version Info