call.js 601 B

1234567891011121314151617181920
  1. "use strict";
  2. exports.__esModule = true;
  3. exports.default = transformCall;
  4. var _utils = require("../utils");
  5. function transformCall(nodePath, state) {
  6. if (state.moduleResolverVisited.has(nodePath)) {
  7. return;
  8. }
  9. const calleePath = nodePath.get('callee');
  10. const isNormalCall = state.normalizedOpts.transformFunctions.some(pattern => (0, _utils.matchesPattern)(state.types, calleePath, pattern));
  11. if (isNormalCall || (0, _utils.isImportCall)(state.types, nodePath)) {
  12. state.moduleResolverVisited.add(nodePath);
  13. (0, _utils.mapPathString)(nodePath.get('arguments.0'), state);
  14. }
  15. }