Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-transform-regexp-constructors

Package Overview
Dependencies
Maintainers
4
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-regexp-constructors - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

6

lib/index.js

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc