🔄 Big News! bazed.ai is now sagentic.ai. Same vision, new name!

Skip to content

@sagentic-ai/sagentic-af / assert

assert() ​

ts
assert(
   origin,
   condition,
   message?,
   source?): void

Asserts that a condition is true, otherwise throws an AssertionError.

Parameters ​

• origin: Identified

The origin object of the assertion.

• condition: boolean

The condition to assert.

• message?: string

An optional message to include in the error.

• source?: Identified

An optional source of the assertion.

Returns ​

void

Throws ​

AssertionError if the condition is false.

Source ​

src/errors.ts:24