MCPcopy Index your code
hub / github.com/glideapps/quicktype / defined

Function defined

src/Support.ts:30–33  ·  view source on GitHub ↗
(x: T | undefined)

Source from the content-addressed store, hash-verified

28}
29
30export function defined<T>(x: T | undefined): T {
31 if (x !== undefined) return x;
32 return panic("Defined value expected, but got undefined");
33}
34
35export function nonNull<T>(x: T | null): T {
36 if (x !== null) return x;

Callers 15

CompressedJSONClass · 0.90
callForNamedTypeFunction · 0.90
currentCodePointFunction · 0.90
combineWordsFunction · 0.90
makeEnumMethod · 0.90
topLevelsMethod · 0.90
TypeGraphClass · 0.90
TypeBuilder.tsFile · 0.90
replaceClassFunction · 0.90
convertToTypeFunction · 0.90
sourceLineLengthFunction · 0.90

Calls 1

panicFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…