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

Function unwrap

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

Source from the content-addressed store, hash-verified

116}
117
118export function unwrap<T>(x: T | undefined | null, message?: string, ...extra_info: any[]): T {
119 if (x === undefined || x === null) {
120 fail('Unwrap failed', message, extra_info);
121 }
122 return x;
123}
124
125// Take a type value that is maybe a string and ensure it is
126// T is syntax sugar for unwrapping to a string union

Callers 15

prepareOptRemarksArgsMethod · 0.70
prepareArgumentsMethod · 0.70
generateIRMethod · 0.70
generateOptPipelineMethod · 0.70
doExecutionMethod · 0.70
loadFromStorageMethod · 0.70
getInstancesMethod · 0.70
loadAwsConfigFunction · 0.70
getConfigFunction · 0.70
asyncSetupFunction · 0.70
cacheGetMethod · 0.70

Calls 1

failFunction · 0.70

Tested by

no test coverage detected