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

Function done

src/sidebarApps/searchInFiles/worker.js:245–260  ·  view source on GitHub ↗

* Sends a message to the main thread to indicate that the worker is done searching * or replacing. * @param {boolean} ratio * @param {'search'|'replace'} mode

(ratio, mode)

Source from the content-addressed store, hash-verified

243 * @param {'search'|'replace'} mode
244 */
245function done(ratio, mode) {
246 if (ratio === 1) {
247 self.postMessage({
248 action: "progress",
249 data: 100,
250 });
251 self.postMessage({
252 action: `done-${mode === "search" ? "searching" : "replacing"}`,
253 });
254 } else {
255 self.postMessage({
256 action: "progress",
257 data: Math.floor(ratio * 100),
258 });
259 }
260}
261
262/**
263 * Creates a skip function that filters files based on exclusion and inclusion patterns.

Callers 2

processFilesFunction · 0.85
finishOneFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected