lib/rules/no-self-compare.js
function hasSameTokens(nodeA, nodeB) {
            const tokensA = sourceCode.getTokens(nodeA);
            const tokensB = sourceCode.getTokens(nodeB);

            return tokensA.length === tokensB.length &&
                tokensA.every((token, index) => token.type === tokensB[index].type && token.value === tokensB[index].value);
        }
function hasSameTokens(nodeA, nodeB) {
            const tokensA = sourceCode.getTokens(nodeA);
            const tokensB = sourceCode.getTokens(nodeB);

            return tokensA.length === tokensB.length &&
                tokensA.every((token, index) => token.type === tokensB[index].type && token.value === tokensB[index].value);
        }
function hasSameTokens ( nodeA , nodeB ) { const tokensA = sourceCode . getTokens ( nodeA ) ; const tokensB = sourceCode . getTokens ( nodeB ) ; return tokensA . length === tokensB . length && tokensA . every ( ( token , index ) => token . type === tokensB [ index ] . type && token . value === tokensB [ index ] . value ) ; }
Determines whether two nodes are composed of the same tokens.
@param {ASTNode} nodeA The first node
@param {ASTNode} nodeB The second node
@returns {boolean} true if the nodes have identical token representations
Determines whether two nodes are composed of the same tokens .