Skip to content

Utils.Function.assert

Christian d'Heureuse edited this page Sep 25, 2026 · 1 revision

commons-math-interpolation / Utils / assert

Function: assert()

function assert(cond, msg?): asserts cond;

Defined in: Utils.ts:27

Throws an exception if the passed condition is not true.

This is a TypeScript assertion function. After a call, the compiler narrows cond to true.

Parameters

cond

boolean

The condition to be checked.

msg?

string

An optional message for the exception.

Returns

asserts cond

Throws

Error If cond is not true.

Clone this wiki locally