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
Parameter | Type | Description |
---|---|---|
value | any | The value to assert. |
message | string | The message format string to display on error. |
extra | any[] | Optional values used to populate the message format string. |
(Returns) | asserts value |