path-to-regexp
Advanced tools
Comparing version 2.3.0 to 2.4.0
@@ -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 @@ ================== |
@@ -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 @@ */ |
@@ -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: `'/'`) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27372
388
242