* Emit a line of code. * @param code The contents, if not specified, just adds a newline
(code?: string)
| 57 | * @param code The contents, if not specified, just adds a newline |
| 58 | */ |
| 59 | public line(code?: string) { |
| 60 | const spaces: number = this.indent * this.indentLevel; |
| 61 | const prefix = " ".repeat(spaces); |
| 62 | this.file.addLine((prefix + (code ?? "")).trimEnd()); |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * Opens a code block and increases the indentation level. |
no test coverage detected