6a9a2af61889bd43929f7e907295aca08b215ecb603fa9d36ccd2ef1834e6edb229f4f0cd474bd314d1398e36813a58d6be2b89845fbf7478949af34fcb5a0 776 B

123456789101112131415161718192021222324252627
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = isBinding;
  6. var _getBindingIdentifiers = require("../retrievers/getBindingIdentifiers.js");
  7. function isBinding(node, parent, grandparent) {
  8. if (grandparent && node.type === "Identifier" && parent.type === "ObjectProperty" && grandparent.type === "ObjectExpression") {
  9. return false;
  10. }
  11. const keys = _getBindingIdentifiers.default.keys[parent.type];
  12. if (keys) {
  13. for (let i = 0; i < keys.length; i++) {
  14. const key = keys[i];
  15. const val = parent[key];
  16. if (Array.isArray(val)) {
  17. if (val.includes(node)) return true;
  18. } else {
  19. if (val === node) return true;
  20. }
  21. }
  22. }
  23. return false;
  24. }
  25. //# sourceMappingURL=isBinding.js.map