MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / assert

Function assert

shared/assert.ts:69–73  ·  view source on GitHub ↗
(c: unknown, message?: string, ...extra_info: any[])

Source from the content-addressed store, hash-verified

67}
68
69export function assert(c: unknown, message?: string, ...extra_info: any[]): asserts c {
70 if (!c) {
71 fail('Assertion failed', message, extra_info);
72 }
73}
74
75export function unwrap<T>(x: T | undefined | null, message?: string, ...extra_info: any[]): T {
76 if (x === undefined || x === null) {

Callers 1

constructorMethod · 0.70

Calls 1

failFunction · 0.70

Tested by

no test coverage detected