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

path-to-regexp

Package Overview
Dependencies
Maintainers
5
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

path-to-regexp - npm Package Compare versions

Comparing version 3.2.0 to 3.3.0

13

index.js

@@ -93,2 +93,3 @@ /**

var delimiter = prev || defaultDelimiter
var prevText = prev || (typeof tokens[tokens.length - 1] === 'string' ? tokens[tokens.length - 1] : '')

@@ -103,3 +104,3 @@ tokens.push({

? escapeGroup(pattern)
: '[^' + escapeString(delimiter === defaultDelimiter ? delimiter : (delimiter + defaultDelimiter)) + ']+?'
: restrictBacktrack(delimiter, defaultDelimiter, prevText)
})

@@ -116,2 +117,12 @@ }

function restrictBacktrack (delimiter, defaultDelimiter, prevText) {
var charGroup = '[^' + escapeString(delimiter === defaultDelimiter ? delimiter : (delimiter + defaultDelimiter)) + ']'
if (!prevText || prevText.indexOf(delimiter) > -1 || prevText.indexOf(defaultDelimiter) > -1) {
return charGroup + '+?'
}
return escapeString(prevText) + '|(?:(?!' + escapeString(prevText) + ')' + charGroup + ')+?'
}
/**

@@ -118,0 +129,0 @@ * Compile a string to a template function for the path.

2

package.json
{
"name": "path-to-regexp",
"description": "Express style path to RegExp utility",
"version": "3.2.0",
"version": "3.3.0",
"main": "index.js",

@@ -6,0 +6,0 @@ "typings": "index.d.ts",

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