MCPcopy
hub / github.com/ts-essentials/ts-essentials / assert

Function assert

lib/functions/assert/index.ts:1–5  ·  view source on GitHub ↗
(condition: any, message: string = "no additional info provided")

Source from the content-addressed store, hash-verified

1export function assert(condition: any, message: string = "no additional info provided"): asserts condition {
2 if (!condition) {
3 throw new Error("Assertion Error: " + message);
4 }
5}

Callers 1

testAssertFunction · 0.85

Calls

no outgoing calls

Tested by 1

testAssertFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…