Socket
Socket
Sign inDemoInstall

@babel/plugin-transform-named-capturing-groups-regex

Package Overview
Dependencies
62
Maintainers
5
Versions
45
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.6.0 to 7.6.2

23

lib/index.js

@@ -8,6 +8,6 @@ "use strict";

function _regexpTree() {
const data = _interopRequireDefault(require("regexp-tree"));
function _regexpuCore() {
const data = _interopRequireDefault(require("regexpu-core"));
_regexpTree = function () {
_regexpuCore = function () {
return data;

@@ -42,11 +42,16 @@ };

const result = _regexpTree().default.compatTranspile(node.extra.raw, ["namedCapturingGroups"]);
const namedCapturingGroups = {};
const result = (0, _regexpuCore().default)(node.pattern, node.flags, {
namedGroup: true,
lookbehind: true,
const {
namedCapturingGroups
} = result.getExtra();
onNamedGroup(name, index) {
namedCapturingGroups[name] = index;
}
if (namedCapturingGroups && Object.keys(namedCapturingGroups).length > 0) {
node.pattern = result.getSource();
});
if (Object.keys(namedCapturingGroups).length > 0) {
node.pattern = result;
if (runtime && !isRegExpTest(path)) {

@@ -53,0 +58,0 @@ path.replaceWith(t.callExpression(this.addHelper("wrapRegExp"), [node, t.valueToNode(namedCapturingGroups)]));

{
"name": "@babel/plugin-transform-named-capturing-groups-regex",
"version": "7.6.0",
"version": "7.6.2",
"description": "Compile regular expressions using named groups to ES5.",

@@ -14,6 +14,10 @@ "homepage": "https://babeljs.io/",

],
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-named-capturing-groups-regex",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-plugin-transform-named-capturing-groups-regex"
},
"bugs": "https://github.com/babel/babel/issues",
"dependencies": {
"regexp-tree": "^0.1.13"
"regexpu-core": "^4.6.0"
},

@@ -24,7 +28,8 @@ "peerDependencies": {

"devDependencies": {
"@babel/core": "^7.6.0",
"@babel/core": "^7.6.2",
"@babel/helper-plugin-test-runner": "^7.0.0",
"core-js-pure": "^3.0.0"
"core-js": "^3.2.1",
"core-js-pure": "^3.2.1"
},
"gitHead": "cbd5a26e57758e3f748174ff84aa570e8780e85d"
"gitHead": "b9cb4af953afb1a5aeed9b18526192ab15bb45c1"
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc