Companion

object Companion

Functions

Link copied to clipboard
fun jsonString(prettyPrint: Boolean = false, action: JSONWriter.() -> Unit): String

Create a JSONWriter, use it as the receiver for the action, then produce and answer a String from the writer. Use the prettyPrint flag if present, defaulting to false.

Link copied to clipboard
fun newPrettyPrinterWriter(): JSONWriter

Answer a JSONWriter that targets an internal StringWriter and pretty-prints the content.

Link copied to clipboard
fun newWriter(): JSONWriter

Answer a JSONWriter that targets an internal StringWriter.