Update structured-merge-diff to latest version

This commit is contained in:
Antoine Pelisse
2019-11-06 09:53:38 -08:00
parent be1658e08c
commit 4f0346530d
24 changed files with 485 additions and 201 deletions

View File

@@ -104,7 +104,7 @@ func GuessBestListPathElement(index int, item value.Value) PathElement {
return PathElement{Index: &index}
}
var keys []value.Field
var keys value.FieldList
for _, name := range AssociativeListCandidateFieldNames {
f, ok := item.MapValue.Get(name)
if !ok {
@@ -117,7 +117,8 @@ func GuessBestListPathElement(index int, item value.Value) PathElement {
keys = append(keys, *f)
}
if len(keys) > 0 {
return PathElement{Key: &value.Map{Items: keys}}
keys.Sort()
return PathElement{Key: &keys}
}
return PathElement{Index: &index}
}