Currently, Record<K, T>
is defined as:
type Record<K extends keyof any, T> = {
[P in K]: T;
};
Why isn't it defined as:
type Record<K extends keyof any, T> = {
[P in K]?: T;
};
That seems like it would be safer, because in most cases you would need to verify that a particular key existed on the object before you could go ahead and read it.