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
DeepMutable<T>
Related to #27 and #111. We have DeepPartial<T>, DeepRequired<T>, and DeepReadonly<T>. We should also add DeepMutable<T>.
DeepPartial<T>
DeepRequired<T>
DeepReadonly<T>
Similar to #112, maybe we should have a DeepOptional<T> that would be an alias of DeepPartial<T>.
DeepOptional<T>
export type DeepMutable<T> = T extends ((...args: any[]) => any) | Primitive | null | undefined ? T : T extends _DeepMutableArray<any> ? _DeepMutableArray<T[number]> : T extends _DeepMutableObject<infer U> ? _DeepMutableObject<U> : never; /** @private */ // tslint:disable-next-line:class-name export interface _DeepMutableArray<T> extends Array<DeepMutable<T>> {} /** @private */ export type _DeepMutableObject<T> = { -readonly [P in keyof T]: DeepMutable<T[P]> };
TypeScript users.
The text was updated successfully, but these errors were encountered:
Hey, thanks for the suggestion, it would be great to have this type. Contributions are welcome!
Sorry, something went wrong.
No branches or pull requests
Is your feature request related to a real problem or use-case?
Related to #27 and #111.
We have
DeepPartial<T>
,DeepRequired<T>
, andDeepReadonly<T>
. We should also addDeepMutable<T>
.Similar to #112, maybe we should have a
DeepOptional<T>
that would be an alias ofDeepPartial<T>
.Describe a solution including usage in code example
Who does this impact? Who is this for?
TypeScript users.
The text was updated successfully, but these errors were encountered: