A new start

This commit is contained in:
2018-11-24 14:43:59 +01:00
commit 3c32c8a37a
24054 changed files with 1376258 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import { declare } from "@babel/helper-plugin-utils";
import rewritePattern from "regexpu-core";
import * as regex from "@babel/helper-regex";
export default declare(api => {
api.assertVersion(7);
return {
visitor: {
RegExpLiteral(path) {
const node = path.node;
if (!regex.is(node, "s")) {
return;
}
node.pattern = rewritePattern(node.pattern, node.flags, {
dotAllFlag: true,
useUnicodeFlag: regex.is(node, "u"),
});
regex.pullFlag(node, "s");
},
},
};
});