MCPcopy
hub / github.com/material-shell/material-shell / assertNotNull

Function assertNotNull

src/utils/assert.ts:3–8  ·  view source on GitHub ↗
(value: T | null | undefined)

Source from the content-addressed store, hash-verified

1import GLib from 'gi://GLib';
2
3export function assertNotNull<T>(value: T | null | undefined): T {
4 if (value === null || value === undefined) {
5 throw Error(`Expected value, but found ${value}`);
6 }
7 return value;
8}
9
10export function assert(
11 shouldBeTrue: boolean,

Callers 15

constructorMethod · 0.90
registerToSignalsMethod · 0.90
restorePanelActorsMethod · 0.90
buildMenuMethod · 0.90
getResultMetasMethod · 0.90
trackAppChangesMethod · 0.90
onMetaWindowsChangedMethod · 0.90
setLayoutByKeyMethod · 0.90
onTileableListChangeMethod · 0.90
constructorMethod · 0.90

Calls 1

ErrorEnum · 0.50

Tested by

no test coverage detected