You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

eslint-plugin-regexp

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-regexp - npm Package Compare versions

Comparing version

to
0.7.1

25

dist/rules/no-dupe-disjunctions.js

@@ -30,4 +30,28 @@ "use strict";

const sourceCode = context.getSourceCode();
function hasAfterPattern(node) {
if (node.type === "Assertion") {
return false;
}
if (node.type === "Pattern") {
return false;
}
let target = node;
let parent = target.parent;
while (parent) {
if (parent.type === "Alternative") {
const index = parent.elements.indexOf(target);
return index < parent.elements.length - 1;
}
if (parent.type === "Quantifier") {
target = parent;
parent = target.parent;
continue;
}
return false;
}
return false;
}
function createVisitor(node, _p, flags) {
function verify(regexpNode) {
const canOmitRight = disallowNeverMatch && !hasAfterPattern(regexpNode);
const leftAlts = [];

@@ -38,2 +62,3 @@ for (const alt of regexpNode.alternatives) {

flags: { left: flags, right: flags },
canOmitRight,
}))

@@ -40,0 +65,0 @@ : leftAlts.find((leftAlt) => regexp_ast_1.isEqualNodes(leftAlt, alt, (a, _b) => {

@@ -489,2 +489,7 @@ "use strict";

}
if (!options.canOmitRight) {
if (rightIndex < right.length) {
return false;
}
}
while (leftIndex < left.length) {

@@ -491,0 +496,0 @@ const le = left[leftIndex];

4

package.json
{
"name": "eslint-plugin-regexp",
"version": "0.7.0",
"version": "0.7.1",
"description": "ESLint plugin for finding RegExp mistakes and RegExp style guide violations.",

@@ -67,3 +67,3 @@ "main": "dist/index.js",

"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-regexp": "^0.6.0",
"eslint-plugin-regexp": "^0.7.0",
"eslint-plugin-vue": "^7.5.0",

@@ -70,0 +70,0 @@ "eslint-plugin-yml": "^0.9.0",