You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But I'm not convinced. We either have strong typing or not. if someone is depending on runtime data without statically declaring them it is their problem and can case the types to a wide type
If someone is depending on runtime data without statically declaring them it is their problem.
At the moment, TypeScript does not differentiate between own keys and enumerable keys, both which are not covered by Object.keys(). So there is a lot of ways, intentionally or unintentionally Object.keys() typed as suggested would give back bad information.
TypeScript Version: 2.5
Currently
Object.keys
type iskeys<T>(o: {}): string[];
but instead it can bekeys<T = {}>(o: T): keyof T;
so return type is a union of keys.Any reason this hasn't been done before? I can make a PR if this is an acceptable change
The text was updated successfully, but these errors were encountered: