* 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)
| 243 | * @param {'search'|'replace'} mode |
| 244 | */ |
| 245 | function 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. |
no outgoing calls
no test coverage detected