(string: String)
| 25 | } |
| 26 | |
| 27 | function findClosingBrace(string: String) { |
| 28 | let codeBlocksCounter = 0; |
| 29 | let characterCounter = 0; |
| 30 | while (characterCounter < string.length) { |
| 31 | const ch = string[characterCounter]; |
| 32 | if (ch === "{") codeBlocksCounter++; |
| 33 | else if (ch === "}") codeBlocksCounter--; |
| 34 | if (codeBlocksCounter == -1) return characterCounter; |
| 35 | characterCounter++; |
| 36 | } |
| 37 | return null; |
| 38 | } |
| 39 | |
| 40 | function resetToOriginalState(filePath: string) { |
| 41 | const path = require('node:path'); |
no outgoing calls
no test coverage detected