type-fest
type-fest copied to clipboard
`keyof` for Map
Context: https://stackoverflow.com/q/60737502
const obj = {first: 'First Name', last: 'Last Name'};
type Keys = keyof typeof obj; // first | last
const map = new Map([
[first, 'First Name'],
[last: 'Last Name']
]);
type Keys = ????????
👍
- Related/similar: https://github.com/sindresorhus/type-fest/issues/115