(code: string)
| 1 | import { Token } from 'cst'; |
| 2 | |
| 3 | function addInconsistentIndentation(code: string) { |
| 4 | const lines = code.split('\n'); |
| 5 | for (let i = 0; i < lines.length; i++) { |
| 6 | const text = lines[i].trim(); |
| 7 | |
| 8 | if (text !== '') { |
| 9 | const indentation = getRandomWhitespace(); |
| 10 | lines[i] = indentation + text; |
| 11 | } |
| 12 | } |
| 13 | return lines.join('\n'); |
| 14 | } |
| 15 | |
| 16 | function addRandomWhiteSpace(code: any) { |
| 17 | code.selectTokensByType('Punctuator').forEach((token: any) => { |
no test coverage detected