sindresorhus/type-fest

`keyof` for Map

Open

#225 opened on Jul 1, 2021

View on GitHub
 (3 comments) (4 reactions) (0 assignees)TypeScript (471 forks)batch import
help wantedtype addition

Repository metrics

Stars
 (12,328 stars)
PR merge metrics
 (Avg merge 3d 5h) (11 merged PRs in 30d)

Description

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 = ????????

Contributor guide