index.js 595 B

1234567891011121314151617181920212223242526
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = _default;
  6. var _helperCreateRegexpFeaturesPlugin = require("@babel/helper-create-regexp-features-plugin");
  7. function _default(core, options) {
  8. const {
  9. runtime = true
  10. } = options;
  11. if (typeof runtime !== "boolean") {
  12. throw new Error("The 'runtime' option must be boolean");
  13. }
  14. return (0, _helperCreateRegexpFeaturesPlugin.createRegExpFeaturePlugin)({
  15. name: "transform-named-capturing-groups-regex",
  16. feature: "namedCaptureGroups",
  17. options: {
  18. runtime
  19. }
  20. });
  21. }