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.
This commit is contained in:
Kim Alvefur 2023-06-09 17:26:38 +02:00
parent 49a01865b6
commit f3414a43d8

View file

@ -96,6 +96,10 @@ local function new(opt)
opt.itemlast = opt.itemlast or "";
opt.equals = opt.equals or "=";
opt.unquoted = true;
elseif opt.preset == "pretty" then
opt.fatal = false;
opt.freeze = true;
opt.unquoted = true;
end
local fallback = opt.fallback or opt.fatal == false and nonfatal_fallback or fatal_error;