File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -133,14 +133,15 @@ encodeDumpProject rawConfig format p
133
133
| ConfigDumpYaml <- format = dumpProject (\ e d ->
134
134
either (const e) encodeUtf8 (cfgRedress rawConfig d " " ))
135
135
| ConfigDumpJson <- format = dumpProject (\ _ d ->
136
- let cmp = cfgKeyCompare rawConfig d " "
137
- in toStrictBytes $ encodePretty' (Aeson. defConfig{confCompare = cmp}) d)
136
+ toStrictBytes $ encodePretty' (cfgPretty d) d)
138
137
where
139
138
-- REVIEW: Is there a way to encode straight to keymap?
140
139
-- encode project to bytestring then decode to keymap.
141
140
dumpProject f = let e = Yaml. encode p in Yaml. decodeEither' e &
142
141
either (const e) (\ (d :: KeyMap Yaml. Value ) -> f e d)
143
142
143
+ cfgPretty d = Aeson. defConfig{confCompare = cfgKeyCompare rawConfig d " " }
144
+
144
145
cfgKeyCompare :: RawYaml -> KeyMap Yaml. Value -> Text -> (Text -> Text -> Ordering )
145
146
cfgKeyCompare (yamlLines -> configLines) (fmap Key. toText . KeyMap. keys -> keys) cmdKey =
146
147
compareInOrder configLines (coerce keys) (coerce cmdKey)
You can’t perform that action at this time.
0 commit comments