MCPcopy Create free account
hub / github.com/Effect-TS/effect / resolveId

Function resolveId

packages/tools/doctest/src/Plugin.ts:73–90  ·  view source on GitHub ↗
(source, importer, options)

Source from the content-addressed store, hash-verified

71 return { test: { runner } satisfies TestUserConfig }
72 },
73 resolveId(source, importer, options) {
74 const collector = Protocol.request(Protocol.collectorPrefix, source)
75 if (collector !== undefined) {
76 return Protocol.resolvedId("collector", collector)
77 }
78
79 const snippet = Protocol.request(Protocol.snippetPrefix, source)
80 if (snippet !== undefined && store.has(snippet.file)) {
81 return Protocol.resolvedId("snippet", snippet)
82 }
83
84 const parent = importer === undefined ? undefined : Protocol.resolvedRequest(importer)
85 if (parent?.kind !== "snippet") {
86 return null
87 }
88
89 return this.resolve(source, parent.file, { ...options, skipSelf: true })
90 },
91 load(id) {
92 const loaded = Protocol.resolvedRequest(id)
93 if (loaded === undefined) {

Callers

nothing calls this directly

Calls 2

requestMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected