mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-07 02:48:27 +08:00
Fixed equals operator for top level node
This commit is contained in:
@@ -12,10 +12,13 @@ func equalsOperator(d *dataTreeNavigator, matchingNodes *list.List, pathNode *Pa
|
||||
func isEquals(d *dataTreeNavigator, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) {
|
||||
value := false
|
||||
|
||||
if lhs.Node.Tag == "!!null" {
|
||||
value = (rhs.Node.Tag == "!!null")
|
||||
lhsNode := UnwrapDoc(lhs.Node)
|
||||
rhsNode := UnwrapDoc(rhs.Node)
|
||||
|
||||
if lhsNode.Tag == "!!null" {
|
||||
value = (rhsNode.Tag == "!!null")
|
||||
} else {
|
||||
value = matchKey(lhs.Node.Value, rhs.Node.Value)
|
||||
value = matchKey(lhsNode.Value, rhsNode.Value)
|
||||
}
|
||||
log.Debugf("%v == %v ? %v", NodeToString(lhs), NodeToString(rhs), value)
|
||||
return createBooleanCandidate(lhs, value), nil
|
||||
|
||||
Reference in New Issue
Block a user