These are chat archives for ramda/ramda

20th
Dec 2018
Daniel Lugo
@danlugo92
Dec 20 2018 00:24
Yeah most likely that
Einar Norðfjörð
@nordfjord
Dec 20 2018 01:29
const prop = <K extends string>(p: K) => <T extends { [key: string]: any }>(obj: T): T[K] => obj[p]

const stuff = { key: 'key', num: 0 };

const a = [stuff].map(prop('num')); // number[]

const b = [stuff].map(prop('key')); // string[]

const c = [stuff].map(prop('whatever’)) // unknown[]
This type seems to work fine