mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-05-02 20:29:29 +08:00
27 lines
No EOL
998 B
Text
27 lines
No EOL
998 B
Text
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.isNodeEqual = void 0;
|
|
const utils_1 = require("@typescript-eslint/utils");
|
|
function isNodeEqual(a, b) {
|
|
if (a.type !== b.type) {
|
|
return false;
|
|
}
|
|
if (a.type === utils_1.AST_NODE_TYPES.ThisExpression &&
|
|
b.type === utils_1.AST_NODE_TYPES.ThisExpression) {
|
|
return true;
|
|
}
|
|
if (a.type === utils_1.AST_NODE_TYPES.Literal && b.type === utils_1.AST_NODE_TYPES.Literal) {
|
|
return a.value === b.value;
|
|
}
|
|
if (a.type === utils_1.AST_NODE_TYPES.Identifier &&
|
|
b.type === utils_1.AST_NODE_TYPES.Identifier) {
|
|
return a.name === b.name;
|
|
}
|
|
if (a.type === utils_1.AST_NODE_TYPES.MemberExpression &&
|
|
b.type === utils_1.AST_NODE_TYPES.MemberExpression) {
|
|
return (isNodeEqual(a.property, b.property) && isNodeEqual(a.object, b.object));
|
|
}
|
|
return false;
|
|
}
|
|
exports.isNodeEqual = isNodeEqual;
|
|
//# sourceMappingURL=isNodeEqual.js.map |