(source: string, ext: string = ".tsx")
| 6 | import * as os from "node:os"; |
| 7 | |
| 8 | function withTempFile(source: string, ext: string = ".tsx"): string { |
| 9 | const tmpDir = os.tmpdir(); |
| 10 | const filePath = path.join(tmpDir, `test-text-${Date.now()}-${Math.random().toString(36).slice(2, 8)}${ext}`); |
| 11 | fs.writeFileSync(filePath, source, "utf-8"); |
| 12 | return filePath; |
| 13 | } |
| 14 | |
| 15 | function buildTextEditAnchor(originalText: string, newText: string): TextEditAnchor | undefined { |
| 16 | if (originalText === newText) return undefined; |
no outgoing calls
no test coverage detected