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

Function unwrapString

lib/assert.ts:127–132  ·  view source on GitHub ↗
(x: any, message?: string, ...extra_info: any[])

Source from the content-addressed store, hash-verified

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
127export function unwrapString<T extends string>(x: any, message?: string, ...extra_info: any[]): T {
128 if (!isString(x)) {
129 fail('String unwrap failed', message, extra_info);
130 }
131 return x as T;
132}

Callers 15

startWineInitFunction · 0.70
executeWineDirectFunction · 0.70
storedCodeHandlerMethod · 0.50
storedStateHandlerMethod · 0.50
unstoredStateHandlerMethod · 0.50
simpleLayoutHandlerMethod · 0.50
renderNoScriptLayoutMethod · 0.50
shortlinkInfoHandlerMethod · 0.50

Calls 2

isStringFunction · 0.85
failFunction · 0.70

Tested by

no test coverage detected