assert
Import from @varavel/vdl-plugin-sdk/utils/misc.
Asserts that a given condition is true. If the condition is false, an error is thrown with the provided message.
Parameters
| Parameter | Type | Description |
|---|---|---|
condition |
unknown |
The condition to evaluate. |
message |
string |
The error message to throw if the condition is false. |
Returns
asserts condition
Returns void if the condition is true.
Throws
Throws an error if the condition is false.