Closed as not planned
Closed as not planned
Description
Bug Report
π Search Terms
type generic remove optional attribute
π Version & Regression Information
I did test this on 4.4.4 and 4.5.0-beta using playground
β― Playground Link
Playground link with relevant code
π» Code
type NullableType<T> = {
[K in keyof T]-?: undefined extends T[K]
? T[K] | null | undefined
: T[K]
}
π Actual behavior
Removing optional attribute from type also remove undefined from final type
(when not removing optional attribute, final type is x?: typeof x | null | undefined)
π Expected behavior
Removing optional attribute just removes the optional attribute and doesn't modify final type