MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / getFile

Function getFile

src/sidebarApps/searchInFiles/worker.js:229–237  ·  view source on GitHub ↗

* Retrieves the contents of a file from the main thread. * @param {string} url * @param {function} cb

(url, cb)

Source from the content-addressed store, hash-verified

227 * @param {function} cb
228 */
229function getFile(url, cb) {
230 const id = Number.parseInt(Date.now() + Math.random() * 1000000);
231 resolvers[id] = cb;
232 self.postMessage({
233 action: "get-file",
234 data: url,
235 id,
236 });
237}
238
239/**
240 * Sends a message to the main thread to indicate that the worker is done searching

Callers 1

processFileFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected