Changeset

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
parents 13130:0b650a54ff9a
children 13132:5bfcfd12c423
files util/serialization.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/util/serialization.lua	Wed Jun 07 16:56:53 2023 +0200
+++ b/util/serialization.lua	Fri Jun 09 17:26:38 2023 +0200
@@ -96,6 +96,10 @@
 		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;