Software / code / prosody
Comparison
util/serialization.lua @ 13131:03f1509a6105
util.serialization: Add a "pretty" preset
This is the config I want 90% of the time when just showing data in the
console or so.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 09 Jun 2023 17:26:38 +0200 |
| parent | 12975:d10957394a3c |
comparison
equal
deleted
inserted
replaced
| 13130:0b650a54ff9a | 13131:03f1509a6105 |
|---|---|
| 93 elseif opt.preset == "compact" then | 93 elseif opt.preset == "compact" then |
| 94 opt.indentwith = opt.indentwith or ""; | 94 opt.indentwith = opt.indentwith or ""; |
| 95 opt.itemstart = opt.itemstart or ""; | 95 opt.itemstart = opt.itemstart or ""; |
| 96 opt.itemlast = opt.itemlast or ""; | 96 opt.itemlast = opt.itemlast or ""; |
| 97 opt.equals = opt.equals or "="; | 97 opt.equals = opt.equals or "="; |
| 98 opt.unquoted = true; | |
| 99 elseif opt.preset == "pretty" then | |
| 100 opt.fatal = false; | |
| 101 opt.freeze = true; | |
| 98 opt.unquoted = true; | 102 opt.unquoted = true; |
| 99 end | 103 end |
| 100 | 104 |
| 101 local fallback = opt.fallback or opt.fatal == false and nonfatal_fallback or fatal_error; | 105 local fallback = opt.fallback or opt.fatal == false and nonfatal_fallback or fatal_error; |
| 102 | 106 |