mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-07 02:48:27 +08:00
Generalising the empty array fix to map
This commit is contained in:
@@ -69,10 +69,11 @@ func deleteFromMap(node *CandidateNode, childPath interface{}) {
|
||||
}
|
||||
}
|
||||
node.Content = newContents
|
||||
normaliseEmptyCollectionMapKeyComment(node)
|
||||
}
|
||||
|
||||
func normaliseEmptySequenceMapKeyComment(node *CandidateNode) {
|
||||
if node.Kind != SequenceNode || len(node.Content) != 0 || node.LineComment != "" {
|
||||
func normaliseEmptyCollectionMapKeyComment(node *CandidateNode) {
|
||||
if (node.Kind != SequenceNode && node.Kind != MappingNode) || len(node.Content) != 0 || node.LineComment != "" {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -110,5 +111,5 @@ func deleteFromArray(node *CandidateNode, childPath interface{}) {
|
||||
}
|
||||
}
|
||||
node.Content = newContents
|
||||
normaliseEmptySequenceMapKeyComment(node)
|
||||
normaliseEmptyCollectionMapKeyComment(node)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user