MCPcopy Create free account
hub / github.com/AlexErrant/Pentive / assertNever

Function assertNever

shared/src/utility.ts:13–21  ·  view source on GitHub ↗
(x: never, msg?: string)

Source from the content-addressed store, hash-verified

11
12// https://basarat.gitbook.io/typescript/type-system/discriminated-unions#throw-in-exhaustive-checks
13export function assertNever(x: never, msg?: string): never {
14 if (msg != null) {
15 throw new Error(msg)
16 }
17 throw new Error(
18 `Expected 'never', but got an unexpected value:
19${JSON.stringify(x)}`,
20 )
21}
22
23export function undefinedMap<T, R>(
24 t: T | undefined,

Callers 15

renderTemplateFunction · 0.90
noteOrdsFunction · 0.90
throwawayFunction · 0.90
buildHtmlFunction · 0.90
astEnterFunction · 0.90
serializeFunction · 0.90
handleLabelFunction · 0.90
serializeKindFunction · 0.90
serializeStateFunction · 0.90
serializeNookTypeFunction · 0.90
AddNoteFunction · 0.90
cardsTable.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected