Skip to content

Function: confirm()

ts
function confirm<T>(value: unknown): T;

Confirms that a value is serializable, returning the typecasted value if it is.

Type Parameters

Type ParameterDescription
TThe expected type of the value

Parameters

ParameterTypeDescription
valueunknownThe value to confirm

Returns

T

The value if it is serializable, typecasted to T

Throws

E_PAYLOAD_UNSERIALIZABLE if the value is not serializable