API Reference / @evolu/common / Type / nullableToOptional

Function: nullableToOptional()

function nullableToOptional<Props>(props): ObjectType<NullableToOptionalProps<Props>>;

Defined in: packages/common/src/Type.ts:3608

Converts each “nullable” property (a union that includes Null) into an optional property. This means consumers can omit the property entirely, or set it to null, or set it to the non-null member of the union.

Type Parameters

Type Parameter
Props extends Record<string, AnyType>

Parameters

ParameterType
propsProps

Returns

ObjectType<NullableToOptionalProps<Props>>

Was this page helpful?