From f3414a43d85531ba9dd74c98600b4bd68c3978c4 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 9 Jun 2023 17:26:38 +0200 Subject: 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. --- util/serialization.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'util') diff --git a/util/serialization.lua b/util/serialization.lua index 1f06ea54..ee4751e2 100644 --- a/util/serialization.lua +++ b/util/serialization.lua @@ -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; -- cgit v1.2.3