(builder: BasicBuilder, { indentLevel = 0, newLine = 'none' }: StringifyOptions = {})
| 9 | } |
| 10 | |
| 11 | export function stringify(builder: BasicBuilder, { indentLevel = 0, newLine = class="st">'none' }: StringifyOptions = {}) { |
| 12 | const str = new Writer(indentLevel, undefined).write(builder).toString() |
| 13 | switch (newLine) { |
| 14 | case class="st">'none': |
| 15 | return str |
| 16 | case class="st">'leading': |
| 17 | return class="st">'\n' + str |
| 18 | case class="st">'trailing': |
| 19 | return str + class="st">'\n' |
| 20 | case class="st">'both': |
| 21 | return class="st">'\n' + str + class="st">'\n' |
| 22 | default: |
| 23 | assertNever(newLine, class="st">'Unexpected value') |
| 24 | } |
| 25 | } |
no test coverage detected