index.js 853 B

1234567891011121314151617181920212223
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _helperPluginUtils = require("@babel/helper-plugin-utils");
  7. var _helperBuilderBinaryAssignmentOperatorVisitor = require("@babel/helper-builder-binary-assignment-operator-visitor");
  8. var _core = require("@babel/core");
  9. var _default = exports.default = (0, _helperPluginUtils.declare)(api => {
  10. api.assertVersion("^7.0.0-0 || >8.0.0-alpha <8.0.0-beta");
  11. return {
  12. name: "transform-exponentiation-operator",
  13. visitor: (0, _helperBuilderBinaryAssignmentOperatorVisitor.default)({
  14. operator: "**",
  15. build(left, right) {
  16. return _core.types.callExpression(_core.types.memberExpression(_core.types.identifier("Math"), _core.types.identifier("pow")), [left, right]);
  17. }
  18. })
  19. };
  20. });
  21. //# sourceMappingURL=index.js.map