MCPcopy
hub / github.com/cloudflare/capnweb / map

Method map

src/rpc.ts:344–360  ·  view source on GitHub ↗
(path: PropertyPath, captures: StubHook[], instructions: unknown[])

Source from the content-addressed store, hash-verified

342 }
343
344 map(path: PropertyPath, captures: StubHook[], instructions: unknown[]): StubHook {
345 let entry: ImportTableEntry;
346 try {
347 entry = this.getEntry();
348 } catch (err) {
349 for (let cap of captures) {
350 cap.dispose();
351 }
352 throw err;
353 }
354
355 if (entry.resolution) {
356 return entry.resolution.map(path, captures, instructions);
357 } else {
358 return entry.session.sendMap(entry.importId, path, captures, instructions);
359 }
360 }
361
362 get(path: PropertyPath): StubHook {
363 let entry = this.getEntry();

Callers 1

sendMapMethod · 0.45

Calls 3

getEntryMethod · 0.95
sendMapMethod · 0.80
disposeMethod · 0.65

Tested by

no test coverage detected