API reference / @evolu/common / Type / nullableToOptional
Function: nullableToOptional()
function nullableToOptional<Props>(
props,
): ObjectType<NullableToOptionalProps<Props>>;
Defined in: packages/common/src/Type.ts:3729
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
| Parameter | Type |
|---|---|
props | Props |
Returns
ObjectType<NullableToOptionalProps<Props>>