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

Function ASSERT

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

Source from the content-addressed store, hash-verified

34}
35
36export function ASSERT(description: string, condition: (() => boolean) | any): void {
37 if ((__TEST__ || __DEBUG__) && ((typeof condition === 'function' && !condition()) || !condition)) {
38 logAssert(description);
39 if (__TEST__) {
40 throw new Error(`Assertion failed: ${description}`);
41 }
42 }
43}

Callers 4

initMethod · 0.90
onColorSchemeMessageMethod · 0.90
index.tsFile · 0.90
firefoxPortListenerMethod · 0.90

Calls 1

logAssertFunction · 0.70

Tested by

no test coverage detected