Some minify configuration adjustments

This commit is contained in:
Bjørn Erik Pedersen 2020-03-20 16:34:53 +01:00
parent 574c2959b8
commit 7204b354a9
18 changed files with 173 additions and 143 deletions

View file

@ -14,6 +14,7 @@
package parser
import (
"bytes"
"encoding/json"
"regexp"
"unicode"
@ -35,6 +36,12 @@ func (c LowerCaseCamelJSONMarshaller) MarshalJSON() ([]byte, error) {
converted := keyMatchRegex.ReplaceAllFunc(
marshalled,
func(match []byte) []byte {
// Attributes on the form XML, JSON etc.
if bytes.Equal(match, bytes.ToUpper(match)) {
return bytes.ToLower(match)
}
// Empty keys are valid JSON, only lowercase if we do not have an
// empty key.
if len(match) > 2 {