* feat: implement create-regexp-features-plugin * fix: test input is not effective * refactor: leverage create-regexp-features-plugin * test: add more test cases * test: update test fixture * chore: add type annotation to features * test: add regression test for issue 9892 * add regression test for issue 9199 * address review comments from Nicolò * address review comments from Brian * small tweaks * Enable dotAllFlag when flags includes u
16 lines
483 B
JavaScript
16 lines
483 B
JavaScript
/* eslint-disable @babel/development/plugin-name */
|
|
import { createRegExpFeaturePlugin } from "@babel/helper-create-regexp-features-plugin";
|
|
|
|
export default function(core, options) {
|
|
const { runtime = true } = options;
|
|
if (typeof runtime !== "boolean") {
|
|
throw new Error("The 'runtime' option must be boolean");
|
|
}
|
|
|
|
return createRegExpFeaturePlugin({
|
|
name: "transform-named-capturing-groups-regex",
|
|
feature: "namedCaptureGroups",
|
|
options: { runtime },
|
|
});
|
|
}
|