function done(ratio, mode) {
	if (ratio === 1) {
		self.postMessage({
			action: "progress",
			data: 100,
		});
		self.postMessage({
			action: `done-${mode === "search" ? "searching" : "replacing"}`,
		});
	} else {
		self.postMessage({
			action: "progress",
			data: Math.floor(ratio * 100),
		});
	}
}
Sends a message to the main thread to indicate that the worker is done searching
or replacing.
@param {boolean} ratio
@param {'search'|'replace'} mode