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

Function unwrapString

shared/assert.ts:85–90  ·  view source on GitHub ↗
(x: any, message?: string, ...extra_info: any[])

Source from the content-addressed store, hash-verified

83// single string.
84// T is syntax sugar for unwrapping to a string union
85export function unwrapString<T extends string>(x: any, message?: string, ...extra_info: any[]): T {
86 if (!isString(x)) {
87 fail('String unwrap failed', message, extra_info);
88 }
89 return x as T;
90}

Callers 14

handleThemesMethod · 0.50
filterPassesMethod · 0.50
initCallbacksMethod · 0.50
getExtraPrintDataMethod · 0.50
getInputArgsMethod · 0.50
getInputStdinMethod · 0.50
getCmakeArgsMethod · 0.50
getCompilerIdMethod · 0.50
saveCurrentAsTemplateMethod · 0.50

Calls 2

isStringFunction · 0.85
failFunction · 0.70

Tested by

no test coverage detected