@babel/plugin-transform-sticky-regex
Examples
In
const a = /o+/y;
Out
var a = new RegExp("o+", "y");
Installation
npm install --save-dev @babel/plugin-transform-sticky-regex
Usage
Via .babelrc (Recommended)
.babelrc
{
"plugins": ["@babel/plugin-transform-sticky-regex"]
}
Via CLI
babel --plugins @babel/plugin-transform-sticky-regex script.js
Via Node API
require("@babel/core").transform("code", {
plugins: ["@babel/plugin-transform-sticky-regex"]
});