Urara-Blog/node_modules/.pnpm-store/v3/files/9f/a813c84dba215cab7c276916d1c62eff1107f763459db9958ac42297b1a31403ecc625b41084adf32868851551dc339111f122f889bc404582aa849785fb81
2022-08-14 01:14:53 +08:00

31 lines
No EOL
743 B
Text

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isBinding;
var _getBindingIdentifiers = require("../retrievers/getBindingIdentifiers");
function isBinding(node, parent, grandparent) {
if (grandparent && node.type === "Identifier" && parent.type === "ObjectProperty" && grandparent.type === "ObjectExpression") {
return false;
}
const keys = _getBindingIdentifiers.default.keys[parent.type];
if (keys) {
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
const val = parent[key];
if (Array.isArray(val)) {
if (val.indexOf(node) >= 0) return true;
} else {
if (val === node) return true;
}
}
}
return false;
}