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
however, when I extract the type out of the validator:
type UpdateUser: Awaited<ReturnType<typeof updateUserValidator.validate>> I can see that the resulting type is password: string | null | undefined;. Is there a way to make it password?: string | null | undefined?
I could write a TypeScript helper to accomplish this in user land but it's not that pretty and I was wondering if there is an easier way.
typeMakeUndefinedPropertiesOptional<T>={[PinkeyofT]-?: undefinedextendsT[P] ? P : never}[keyofT]extends infer D
? {[PinkeyofTasPextendsD ? P : never]?: T[P]}&{[PinkeyofTasPextendsD ? never : P]: T[P]}
: nevertypeUndefinedBar={foo: string|null;bar: string|undefined;test: string}typeOptionalBar=MakeUndefinedPropertiesOptional<UndefinedBar>// { bar?: string | undefined } & { test: string; foo: string | null }
Small aside: In the repo, when clicking on "Get Help => Open", a new tab opens but it doesn't fill out the issue template with Question.
The text was updated successfully, but these errors were encountered:
Package version
Latest (1.7.1)
Describe the bug
Thank you for this fantastic library and all the work in Adonis v6! ❤️
I tried to follow https://vinejs.dev/docs/schema_101#nullable-and-optional-modifiers
however, when I extract the type out of the validator:
type UpdateUser: Awaited<ReturnType<typeof updateUserValidator.validate>>
I can see that the resulting type ispassword: string | null | undefined;
. Is there a way to make itpassword?: string | null | undefined
?I could write a TypeScript helper to accomplish this in user land but it's not that pretty and I was wondering if there is an easier way.
Small aside: In the repo, when clicking on "Get Help => Open", a new tab opens but it doesn't fill out the issue template with Question.
The text was updated successfully, but these errors were encountered: