node_modules

This commit is contained in:
saeid
2019-07-15 13:07:31 +04:30
parent d3735c6d30
commit ce1a3ebf9c
35713 changed files with 3639219 additions and 1 deletions
@@ -0,0 +1,32 @@
import { declare } from "@babel/helper-plugin-utils";
import rewritePattern from "regexpu-core";
import * as regex from "@babel/helper-regex";
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 {
name: "proposal-unicode-property-regex",
visitor: {
RegExpLiteral(path) {
const node = path.node;
if (!regex.is(node, "u")) {
return;
}
node.pattern = rewritePattern(node.pattern, node.flags, {
unicodePropertyEscape: true,
useUnicodeFlag,
});
if (!useUnicodeFlag) {
regex.pullFlag(node, "u");
}
},
},
};
});