index.js 797 B

1234567891011121314151617181920212223242526272829
  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 = (0, _helperPluginUtils.declare)(api => {
  10. api.assertVersion(7);
  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. exports.default = _default;