Skip to content

isWrappedValue ​

The isWrappedValue() function is a type guard that checks whether a value is a WrappedValue created via wrapValue/toWrappedValue.

Interactive example ​

Syntax ​

typescript
function isWrappedValue<
	GenericInput extends unknown
>(
	input: GenericInput
): input is Extract<GenericInput, WrappedValue<any>>;

Parameters ​

  • input : Potentially wrapped value to test.

Return value ​

A boolean, and a type narrowing to WrappedValue<...> when true.

See also ​

Released under the MIT license.