* Replace a string in the content of a file. * @param {object} arg - The content of the file to search. * @param {import('lib/fileList').Tree} arg.file - The content of the file to search. * @param {string} content - The content of the file to search. * @param {RegExp} arg.search - The string to
({ file, content, search, replace })
| 147 | * @param {string} arg.replace - The string to replace with. |
| 148 | */ |
| 149 | function replaceInFile({ file, content, search, replace }) { |
| 150 | const text = content.replace(search, replace); |
| 151 | |
| 152 | self.postMessage({ |
| 153 | action: "replace-result", |
| 154 | data: { file, text }, |
| 155 | }); |
| 156 | } |
| 157 | |
| 158 | /** |
| 159 | * Gets surrounding text of a match. |
nothing calls this directly
no outgoing calls
no test coverage detected