mirror of
https://github.com/wader/fq.git
synced 2024-12-23 13:22:58 +03:00
yaml,fuzz: gojq.Normalize value to fix type panic
This commit is contained in:
parent
a49fe00898
commit
2606916753
5
format/yaml/testdata/normalize.fqtest
vendored
Normal file
5
format/yaml/testdata/normalize.fqtest
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
# normalize uint64 to bigint
|
||||
$ fq -n '"[18446744073709551615]" | yaml'
|
||||
[
|
||||
18446744073709551615
|
||||
]
|
@ -45,7 +45,7 @@ func decodeYAML(d *decode.D, _ any) any {
|
||||
}
|
||||
|
||||
var s scalar.S
|
||||
s.Actual = r
|
||||
s.Actual = gojqex.Normalize(r)
|
||||
|
||||
switch s.Actual.(type) {
|
||||
case map[string]any,
|
||||
|
@ -1126,7 +1126,7 @@ func (i *Interp) NewColorJSON(opts Options) (*colorjson.Encoder, error) {
|
||||
if v, ok := toValue(func() Options { return opts }, v); ok {
|
||||
return v
|
||||
}
|
||||
panic(fmt.Sprintf("toValue not a JQValue value: %#v", v))
|
||||
panic(fmt.Sprintf("toValue not a JQValue value: %#v (%T)", v, v))
|
||||
},
|
||||
colorjson.Colors{
|
||||
Reset: []byte(ansi.Reset.SetString),
|
||||
|
Loading…
Reference in New Issue
Block a user