babel-plugin-transform-regexp-constructors
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -17,3 +17,3 @@ "use strict"; | ||
if (prettify) { | ||
pattern = pattern.replace(/\n/g, "\\n").replace(/[\b]/g, "[\\b]").replace(/\v/g, "\\v").replace(/\f/g, "\\f").replace(/\r/g, "\\r"); | ||
pattern = pattern.replace(/\n/g, "\\n").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/[\b]/g, "[\\b]").replace(/\v/g, "\\v").replace(/\f/g, "\\f").replace(/\r/g, "\\r"); | ||
} | ||
@@ -39,6 +39,6 @@ return t.regExpLiteral(pattern, flags); | ||
visitor: { | ||
NewExpression: function NewExpression(path) { | ||
NewExpression(path) { | ||
maybeReplaceWithRegExpLiteral(path, t); | ||
}, | ||
CallExpression: function CallExpression(path) { | ||
CallExpression(path) { | ||
// equivalent to `new RegExp()` according to §21.2.3 | ||
@@ -45,0 +45,0 @@ maybeReplaceWithRegExpLiteral(path, t); |
{ | ||
"name": "babel-plugin-transform-regexp-constructors", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "This changes RegExp constructors into literals if the RegExp arguments are strings.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/babel/babili#readme", |
@@ -24,3 +24,3 @@ # babel-plugin-transform-regexp-constructors | ||
```sh | ||
$ npm install babel-plugin-transform-regexp-constructors | ||
npm install babel-plugin-transform-regexp-constructors | ||
``` | ||
@@ -43,3 +43,3 @@ | ||
```sh | ||
$ babel --plugins transform-regexp-constructors script.js | ||
babel --plugins transform-regexp-constructors script.js | ||
``` | ||
@@ -46,0 +46,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2696