#Map with definite keys and values
7 messages · Page 1 of 1 (latest)
you kinda can't, maps just aren't made for that
weird. The problem seems to me that I can't use a generic that matches the key to the value
as I understand it keyof options is interpreted as possibly two different keys so the value is always all values
see Record<keyof options, options[keyof options]> vs { [K in keyof options]: options[K] }
unfortunately, Map doesn't have something for the latter
well, ok thank you
nitpick:
const o = new Map<keyof options, options[keyof options]>();