We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
entries type is supported to fit more general situations.
type Obj = { [key: string]: number; }; const fn = (obj: Obj) => entries(obj); const res1 = fn({ hello: 3 }); // Generator<[string, number], void, unknown const res2 = entries({ hello: 2 }); // Generator<["hello", number], void, unknown> export const OsTypeEnum = { Android: `android`, Ios: `ios`, Windows: `windows`, } as const; export type OsTypeEnum = (typeof OsTypeEnum)[keyof typeof OsTypeEnum]; type Os = { [key in OsTypeEnum]: string; }; const fn = (obj: Os) => entries(obj); const res4 = fn({ [OsTypeEnum.Android]: "Android", [OsTypeEnum.Ios]: "Ios", [OsTypeEnum.Windows]: "Windows", // only OsTypeEnum key });
The text was updated successfully, but these errors were encountered:
@mkitwave Thank you for your report 👍
Sorry, something went wrong.
ppeeou
Successfully merging a pull request may close this issue.
Suggestion
⭐ Suggestion
entries type is supported to fit more general situations.
💻 Use Cases
The text was updated successfully, but these errors were encountered: