Refactoring JSON encoder prefs

This commit is contained in:
Mike Farah
2024-02-24 15:48:59 +11:00
parent 7a01e216c4
commit 55f6a3a49d
9 changed files with 76 additions and 21 deletions
+5 -1
View File
@@ -13,7 +13,11 @@ func configureEncoder(format *PrinterOutputFormat, indent int) Encoder {
switch format {
case JSONOutputFormat:
return NewJSONEncoder(indent, false, false)
prefs := ConfiguredJsonPreferences.Copy()
prefs.Indent = indent
prefs.ColorsEnabled = false
prefs.UnwrapScalar = false
return NewJSONEncoder(prefs)
case PropsOutputFormat:
return NewPropertiesEncoder(ConfiguredPropertiesPreferences)
case CSVOutputFormat: