@eslint-react/ast 5.9.4 → 5.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +13 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -277,6 +277,19 @@ const isEqual = dual(2, (a, b) => {
|
|
|
277
277
|
case a.type === AST_NODE_TYPES.Identifier && b.type === AST_NODE_TYPES.Identifier: return a.name === b.name;
|
|
278
278
|
case a.type === AST_NODE_TYPES.PrivateIdentifier && b.type === AST_NODE_TYPES.PrivateIdentifier: return a.name === b.name;
|
|
279
279
|
case a.type === AST_NODE_TYPES.MemberExpression && b.type === AST_NODE_TYPES.MemberExpression: return isEqual(a.property, b.property) && isEqual(a.object, b.object);
|
|
280
|
+
case a.type === AST_NODE_TYPES.CallExpression && b.type === AST_NODE_TYPES.CallExpression: {
|
|
281
|
+
if (a.optional !== b.optional) return false;
|
|
282
|
+
if (a.arguments.length !== b.arguments.length) return false;
|
|
283
|
+
if (!isEqual(a.callee, b.callee)) return false;
|
|
284
|
+
let i = a.arguments.length;
|
|
285
|
+
while (i--) {
|
|
286
|
+
const argA = a.arguments[i];
|
|
287
|
+
const argB = b.arguments[i];
|
|
288
|
+
if (argA == null || argB == null) return false;
|
|
289
|
+
if (!isEqual(argA, argB)) return false;
|
|
290
|
+
}
|
|
291
|
+
return true;
|
|
292
|
+
}
|
|
280
293
|
case a.type === AST_NODE_TYPES.JSXIdentifier && b.type === AST_NODE_TYPES.JSXIdentifier: return a.name === b.name;
|
|
281
294
|
case a.type === AST_NODE_TYPES.JSXNamespacedName && b.type === AST_NODE_TYPES.JSXNamespacedName: return isEqual(a.namespace, b.namespace) && isEqual(a.name, b.name);
|
|
282
295
|
case a.type === AST_NODE_TYPES.JSXMemberExpression && b.type === AST_NODE_TYPES.JSXMemberExpression: return isEqual(a.object, b.object) && isEqual(a.property, b.property);
|