toWrappedValue
The toWrappedValue() function ensures a value is wrapped: if it is already a WrappedValue, it is returned as is, otherwise it is wrapped.
Interactive example
Syntax
typescript
function toWrappedValue<
GenericInnerValue extends AnyValue,
GenericInput extends MaybeWrapped<GenericInnerValue>
>(
input: GenericInput
): GenericInput extends WrappedValue ? GenericInput : WrappedValue<GenericInput>;Parameters
input: Value (already wrapped or not) to normalize into aWrappedValue.
Return value
The wrapped value, or the initial value if it was already wrapped.
