2024-02-24 04:48:59 +00:00
|
|
|
package yqlib
|
|
|
|
|
|
|
|
type JsonPreferences struct {
|
|
|
|
Indent int
|
|
|
|
ColorsEnabled bool
|
|
|
|
UnwrapScalar bool
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewDefaultJsonPreferences() JsonPreferences {
|
|
|
|
return JsonPreferences{
|
|
|
|
Indent: 2,
|
|
|
|
ColorsEnabled: true,
|
|
|
|
UnwrapScalar: true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *JsonPreferences) Copy() JsonPreferences {
|
|
|
|
return JsonPreferences{
|
|
|
|
Indent: p.Indent,
|
|
|
|
ColorsEnabled: p.ColorsEnabled,
|
|
|
|
UnwrapScalar: p.UnwrapScalar,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-24 04:59:12 +00:00
|
|
|
var ConfiguredJSONPreferences = NewDefaultJsonPreferences()
|