-? in Typescript
While implementing Required<T>
in typescript I found out that if you want a field to be required you can use -?
notation.
Example:
required.ts
// Make all properties in T required type Required<T> = { [P in keyof T]-?: T[P]; }
While implementing Required<T>
in typescript I found out that if you want a field to be required you can use -?
notation.
Example:
// Make all properties in T required type Required<T> = { [P in keyof T]-?: T[P]; }