Bogdan Savluk 0058b7fef4
Migrate Babel from Flow to TypeScript (except Babel parser) (#11578)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-11-25 23:09:13 +01:00

19 lines
594 B
TypeScript

/* eslint-disable @babel/development/plugin-name */
import { createRegExpFeaturePlugin } from "@babel/helper-create-regexp-features-plugin";
import { declare } from "@babel/helper-plugin-utils";
export default declare((api, options) => {
api.assertVersion(7);
const { useUnicodeFlag = true } = options;
if (typeof useUnicodeFlag !== "boolean") {
throw new Error(".useUnicodeFlag must be a boolean, or undefined");
}
return createRegExpFeaturePlugin({
name: "proposal-unicode-property-regex",
feature: "unicodePropertyEscape",
options: { useUnicodeFlag },
});
});