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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
OptionalKeys<T> & WritableKeys<T> causes error - see code snippet below.
export type OptionalToUndefined<T extends object> = { readonly [K in OptionalKeys<T> & ReadonlyKeys<T>]: T[K] | undefined; } & { [K in OptionalKeys<T> & WritableKeys<T>]: T[K] | undefined; } & { readonly [K in RequiredKeys<T> & ReadonlyKeys<T>]: T[K]; } & { [K in RequiredKeys<T> & WritableKeys<T>]: T[K]; };
OptionalKeys separately can be used as a key. WritableKeys separately can be used as a key.
So, their combination should also be usable.
I use this as temporary solution
export type OptionalToUndefined<T extends object> = { readonly [K in OptionalKeys<T> & ReadonlyKeys<T>]: T[K] | undefined; } & { [K in Exclude<OptionalKeys<T>, ReadonlyKeys<T>>]: T[K] | undefined; } & { readonly [K in RequiredKeys<T> & ReadonlyKeys<T>]: T[K]; } & { [K in RequiredKeys<T> & WritableKeys<T>]: T[K]; };
This error may depend on typescript configuration. If you can't reproduce I will upload reproduction repo.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
馃悶 Bug Report
Describe the bug
OptionalKeys<T> & WritableKeys<T> causes error - see code snippet below.
Reproduce the bug
Expected behavior
OptionalKeys separately can be used as a key.
WritableKeys separately can be used as a key.
So, their combination should also be usable.
Possible Solution
I use this as temporary solution
Screenshots
Additional context
This error may depend on typescript configuration. If you can't reproduce I will upload reproduction repo.
The text was updated successfully, but these errors were encountered: