MCPcopy
hub / github.com/darkreader/darkreader / ASSERT

Function ASSERT

src/inject/utils/log.ts:47–54  ·  view source on GitHub ↗
(description: string, condition: (() => boolean) | any)

Source from the content-addressed store, hash-verified

45}
46
47export function ASSERT(description: string, condition: (() => boolean) | any): void {
48 if ((__TEST__ || __DEBUG__) && ((typeof condition === 'function' && !condition()) || !condition)) {
49 logAssert(description);
50 if (__TEST__) {
51 throw new Error(`Assertion failed: ${description}`);
52 }
53 }
54}

Callers 3

recordUndefinedElementFunction · 0.90
handleIsDefinedFunction · 0.90

Calls 1

logAssertFunction · 0.70

Tested by

no test coverage detected