MCPcopy Index your code
hub / github.com/nodejs/node / hasSameTokens

Function hasSameTokens

tools/eslint-rules/prefer-assert-iferror.js:18–27  ·  view source on GitHub ↗
(nodeA, nodeB)

Source from the content-addressed store, hash-verified

16 let assertImported = false;
17
18 function hasSameTokens(nodeA, nodeB) {
19 const aTokens = sourceCode.getTokens(nodeA);
20 const bTokens = sourceCode.getTokens(nodeB);
21
22 return aTokens.length === bTokens.length &&
23 aTokens.every((token, index) => {
24 return token.type === bTokens[index].type &&
25 token.value === bTokens[index].value;
26 });
27 }
28
29 function checkAssertNode(node) {
30 if (utils.isRequired(node, ['assert'])) {

Callers 1

createFunction · 0.85

Calls 1

everyMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…