Skip to content

assert

@algorandfoundation/algorand-typescript


@algorandfoundation/algorand-typescript / index / assert

Function: assert()

assert(condition, message?): asserts condition

Defined in: packages/algo-ts/src/util.ts:19

Asserts that condition is truthy, otherwise error and halt execution.

Parameters

condition

unknown

An expression that can be evaluated as truthy of falsy

message?

string

The message to show if condition is falsy and an error is raised.

Returns

asserts condition