Skip to content

Commit

Permalink
overlooked
Browse files Browse the repository at this point in the history
  • Loading branch information
restlessronin committed Feb 4, 2024
1 parent 98fa509 commit 794284a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,14 @@ Query.prototype._init = function() {
if (c.name === captureName1) nodes_1.push(c.node);
if (c.name === captureName2) nodes_2.push(c.node);
}
let compare = (n1, n2, positive) => {
return positive ?
n1.text === n2.text :
n1.text !== n2.text;
};
return matchAll
? nodes_1.every(n1 => nodes_2.some(n2 => n1.text === n2.text)) === isPositive
: nodes_1.some(n1 => nodes_2.some(n2 => n1.text === n2.text)) === isPositive;
? nodes_1.every(n1 => nodes_2.some(n2 => compare(n1, n2, isPositive)))
: nodes_1.some(n1 => nodes_2.some(n2 => compare(n1, n2, isPositive)));
});
} else {
captureName = steps[SECOND + 1];
Expand Down

0 comments on commit 794284a

Please sign in to comment.