apiref
tkt@2.0.2

invariant()  Function

Asserts state which your program assumes to be true. If it is false, an error is thrown.

Signature

export declare function invariant(value: any, message: string, ...extra: any[]): asserts value;

Parameters

ParameterTypeDescription
valueany

The value to assert.

messagestring

The message format string to display on error.

extraany[]

Optional values used to populate the message format string.

(Returns)asserts value