MCPcopy Create free account
hub / github.com/apache/tvm / match

Method match

web/src/artifact_cache.ts:161–181  ·  view source on GitHub ↗
(request: RequestLike)

Source from the content-addressed store, hash-verified

159 }
160
161 async match(request: RequestLike): Promise<Response | undefined> {
162 const url = this.normalizeRequest(request);
163 const hash = await this.resolveHashDescriptor(url);
164 if (!hash) {
165 return undefined;
166 }
167 try {
168 const api = this.getApi();
169 if (!api) {
170 return undefined;
171 }
172 const handle = await api.requestFileHandle(hash);
173 if (!handle) {
174 return undefined;
175 }
176 const blob = await handle.getFile();
177 return new Response(blob);
178 } catch {
179 return undefined;
180 }
181 }
182
183 async put(request: RequestLike, response: Response): Promise<void> {
184 const url = this.normalizeRequest(request);

Callers 7

fetchWithCacheMethod · 0.45
addToCacheMethod · 0.45
fetchWithCacheMethod · 0.45
addToCacheMethod · 0.45
hasAllKeysMethod · 0.45

Calls 5

normalizeRequestMethod · 0.95
resolveHashDescriptorMethod · 0.95
getApiMethod · 0.95
requestFileHandleMethod · 0.80
getFileMethod · 0.65

Tested by

no test coverage detected