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

Method readArrayBuffer

web/src/opfs_store.ts:148–162  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

146 }
147
148 async readArrayBuffer(url: string): Promise<ArrayBuffer | undefined> {
149 try {
150 const entry = await this.getStoredEntry(url);
151 if (entry === undefined) {
152 return undefined;
153 }
154 const payload = await this.readPayload(entry.payloadHandle);
155 return payload.byteLength === entry.record.nbytes ? payload : undefined;
156 } catch (err) {
157 if (this.handleCacheMissStateError(err)) {
158 return undefined;
159 }
160 throw err;
161 }
162 }
163
164 async write(url: string, response: Response): Promise<void> {
165 try {

Callers 1

readFromCacheMethod · 0.80

Calls 3

getStoredEntryMethod · 0.95
readPayloadMethod · 0.95

Tested by

no test coverage detected