json_fixer/jsonfixer/
jsonfixer_config.rs1use crate::jsonfixer::jsonformatter::IndentStyle;
2
3#[derive(Debug, Clone)]
4pub struct JsonFixerConfig {
5 pub preserve: bool, pub space_between: bool, pub beautify: bool,
16 pub indent_style: IndentStyle,
17 pub indent_size: usize,
18 pub sort_keys: bool,
19}
20
21impl Default for JsonFixerConfig {
22 fn default() -> Self {
23 Self {
24 preserve: false,
25 space_between: false,
26 beautify: false,
27 indent_style: IndentStyle::Spaces,
28 indent_size: 0,
29 sort_keys: false,
30 }
31 }
32}
33
34impl JsonFixerConfig {
35 pub fn preserve(&self) -> bool {
36 self.preserve
37 }
38
39 pub fn space_between(&self) -> bool {
40 self.space_between && self.preserve == false
41 }
42
43 pub fn beautify(&self) -> bool {
44 self.beautify && self.preserve == false
45 }
46}