JSON pretty-printer: JsonValue tree with JSON.stringify-style indentation. Warm-up package for the moonbit-sqlfmt toolchain.
Warm-up package for the moonbit-sqlfmt project (M0 milestone): it exercises the full declare → test → implement → publish loop.
let json : @json-pretty.JsonValue = Obj([
("name", Str("Alice")),
("age", Number(30.0)),
("tags", Arr([Str("sql"), Str("moonbit")])),
])
println(json.pretty()){
"name": "Alice",
"age": 30,
"tags": [
"sql",
"moonbit"
]
}| Member | Description |
|---|---|
| JsonValue | Null \| Bool(Bool) \| Number(Double) \| Str(String) \| Arr(Array[JsonValue]) \| Obj(Array[(String, JsonValue)]) |
| JsonValue::pretty | (self, indent~ : Int = 2) -> String |
Install
Download zipJSON pretty-printer: JsonValue tree with JSON.stringify-style indentation. Warm-up package for the moonbit-sqlfmt toolchain.