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 2.3.0 to 2.4.0

5

History.md

@@ -0,1 +1,6 @@

2.3.0 / 2018-08-20
==================
* Use `delimiter` when processing repeated matching groups (e.g. `foo/bar` has no prefix, but has a delimiter)
2.2.1 / 2018-04-24

@@ -2,0 +7,0 @@ ==================

6

index.d.ts

@@ -14,6 +14,10 @@ declare function pathToRegexp (path: pathToRegexp.Path, keys?: pathToRegexp.Key[], options?: pathToRegexp.RegExpOptions & pathToRegexp.ParseOptions): RegExp;

/**
* When `false` the regexp will match the beginning instead of the entire string. (default: `true`)
* When `true` the regexp will match to the end of the string. (default: `true`)
*/
end?: boolean;
/**
* When `true` the regexp will match from the beginning of the string. (default: `true`)
*/
start?: boolean;
/**
* Sets the final character for non-ending optimistic matches. (default: `/`)

@@ -20,0 +24,0 @@ */

5

index.js

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

var strict = options.strict
var start = options.start !== false
var end = options.end !== false

@@ -308,3 +309,3 @@ var delimiter = escapeString(options.delimiter || DEFAULT_DELIMITER)

var endsWith = [].concat(options.endsWith || []).map(escapeString).concat('$').join('|')
var route = ''
var route = start ? '^' : ''
var isEndDelimited = tokens.length === 0

@@ -347,3 +348,3 @@

return new RegExp('^' + route, flags(options))
return new RegExp(route, flags(options))
}

@@ -350,0 +351,0 @@

{
"name": "path-to-regexp",
"description": "Express style path to RegExp utility",
"version": "2.3.0",
"version": "2.4.0",
"main": "index.js",

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

@@ -33,3 +33,4 @@ # Path-to-RegExp

- **strict** When `true` the regexp allows an optional trailing delimiter to match. (default: `false`)
- **end** When `false` the regexp will match the beginning instead of the entire string. (default: `true`)
- **end** When `true` the regexp will match to the end of the string. (default: `true`)
- **start** When `true` the regexp will match from the beginning of the string. (default: `true`)
- Advanced options (use for non-pathname strings, e.g. host names):

@@ -36,0 +37,0 @@ - **delimiter** The default delimiter for segments. (default: `'/'`)

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