index.js 646 B

1234567891011121314151617181920212223242526272829303132
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. function _helperPluginUtils() {
  7. const data = require("@babel/helper-plugin-utils");
  8. _helperPluginUtils = function () {
  9. return data;
  10. };
  11. return data;
  12. }
  13. var _default = (0, _helperPluginUtils().declare)(api => {
  14. api.assertVersion(7);
  15. return {
  16. name: "transform-object-assign",
  17. visitor: {
  18. CallExpression: function (path, file) {
  19. if (path.get("callee").matchesPattern("Object.assign")) {
  20. path.node.callee = file.addHelper("extends");
  21. }
  22. }
  23. }
  24. };
  25. });
  26. exports.default = _default;