Skip to main content

Function: typeCheck()

function typeCheck<T>(type, value): TypeCheckError | null;

Checks if a value conforms to a given type.

Type Parameters​

Type ParameterDescription
T extends AnyTypeType.

Parameters​

ParameterTypeDescription
typeTType to check for.
valueTypeToData<T>Value to check.

Returns​

TypeCheckError | null

A TypeError if the check fails or null if no error.