Like the 'Optional' utility type, could we have the equivilant which makes fields of the object nullable instead of optional?
For example if I have the type:
interface IPerson {
name: string;
age: string;
}
I would like a utility type NullableFields (or whatever name) to transform it into the following:
type NullablePerson = NullableFields<IPerson>;
// resulting type is:
{
name: string|null;
age: number|null;
}
// OR type NullableNamePerson = NullableFields<IPerson, 'name'>;
//resulting type is:
{
name: string|null;
age: number;
}
Thanks.
Forgive me if this already exists under another name.
Like the 'Optional' utility type, could we have the equivilant which makes fields of the object nullable instead of optional?
For example if I have the type:
I would like a utility type
NullableFields(or whatever name) to transform it into the following:Thanks.
Forgive me if this already exists under another name.