MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / unwrap

Function unwrap

shared/assert.ts:75–80  ·  view source on GitHub ↗
(x: T | undefined | null, message?: string, ...extra_info: any[])

Source from the content-addressed store, hash-verified

73}
74
75export function unwrap<T>(x: T | undefined | null, message?: string, ...extra_info: any[]): T {
76 if (x === undefined || x === null) {
77 fail('Unwrap failed', message, extra_info);
78 }
79 return x;
80}
81
82// This mainly a utility for JQuery.val(): string | number | string[] | undefined, in our code we typically want a
83// single string.

Callers 15

encode_objectFunction · 0.70
encode_arrayFunction · 0.70
encode_uriFunction · 0.70
readValueMethod · 0.70
getThemeStylesMethod · 0.50
setupPrintViewMethod · 0.50
handleDisplayFunction · 0.50
doFormatRequestFunction · 0.50
calcLocaleChangedDateFunction · 0.50
fixBugsInConfigFunction · 0.50
findConfigFunction · 0.50
sizeRootFunction · 0.50

Calls 1

failFunction · 0.70

Tested by

no test coverage detected