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

Function assert

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

Source from the content-addressed store, hash-verified

110// Using `unknown` instead of generic implementation due to:
111// https://github.com/microsoft/TypeScript/issues/60130
112export function assert(c: unknown, message?: string, ...extra_info: any[]): asserts c {
113 if (!c) {
114 fail('Assertion failed', message, extra_info);
115 }
116}
117
118export function unwrap<T>(x: T | undefined | null, message?: string, ...extra_info: any[]): T {
119 if (x === undefined || x === null) {

Callers 15

cmakeMethod · 0.70
resolveReleaseTrackFunction · 0.70
asyncSetupFunction · 0.70
addToolToCompilerMethod · 0.70
fromClientStateMethod · 0.70
compilerConfigForMethod · 0.70
processOutputMethod · 0.50
execDemanglerMethod · 0.50
addMethod · 0.50

Calls 1

failFunction · 0.70

Tested by

no test coverage detected