I have a type like this one:
interface A {
a: string
b: string | null
}
I would like to generate the same type but each nullable value becomes optional:
interface A {
a: string
b?: string | null
}
Something like that but only for nullable values (this one makes all values optional):
export type NullValuesToOptional<T> = {
[P in keyof T]?: T[P]
}