deno.land / x / rambda@v9.1.1 / source / fromPairs-spec.ts
12345678910111213141516171819202122232425import {fromPairs} from 'rambda'
describe('R.fromPairs - require explicit type for input list', () => { it('with string index', () => { const list: [string, number][] = [ ['a', 1], ['b', 2], ['c', 3], ] const result = fromPairs(list)
result // $ExpectType { [index: string]: number; } }) it('with number index', () => { const list: [number, string][] = [ [10, 'foo'], [20, 'bar'], [30, 'baz'], ] const result = fromPairs(list)
result // $ExpectType { [index: number]: string; } })})
Version Info