mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-01 14:14:52 +08:00
Refactoring JSON encoder prefs
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user