( text: string, fn: (line: string, index: number) => string, )
| 151 | } |
| 152 | |
| 153 | export function transformLines( |
| 154 | text: string, |
| 155 | fn: (line: string, index: number) => string, |
| 156 | ): string { |
| 157 | return text.split(/\r?\n/).map(fn).join('\n'); |
| 158 | } |
| 159 | |
| 160 | export function indentLines(text: string, identation: number): string { |
| 161 | return transformLines(text, line => `${' '.repeat(identation)}${line}`); |
no outgoing calls
no test coverage detected