MCPcopy Create free account
hub / github.com/cloudflare/computer / unscopeOr

Function unscopeOr

packages/computer/src/artifacts/client.ts:231–233  ·  view source on GitHub ↗

* Unscope a name the binding echoed back, falling back to the local * name the caller passed. The binding returns the scoped name it * stored; if it ever returns something without our prefix, prefer * the caller's local name over leaking a foreign-looking value.

(sessionId: string, returned: string, fallback: string)

Source from the content-addressed store, hash-verified

229 * the caller's local name over leaking a foreign-looking value.
230 */
231function unscopeOr(sessionId: string, returned: string, fallback: string): string {
232 return unscopedName(sessionId, returned) ?? fallback;
233}

Callers 2

createFunction · 0.85
importFunction · 0.85

Calls 1

unscopedNameFunction · 0.85

Tested by

no test coverage detected