path-to-regexp 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of path-to-regexp might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +2 -2
  2. package/package.json +1 -1
  3. package/History.md +0 -36
package/index.js CHANGED
@@ -7,7 +7,7 @@ module.exports = pathtoRegexp;
7
7
  /**
8
8
  * Match matching groups in a regular expression.
9
9
  */
10
- var MATCHING_GROUP_REGEXP = /\((?!\?)/g;
10
+ var MATCHING_GROUP_REGEXP = /\((?:\?<(.*?)>)?(?!\?)/g;
11
11
 
12
12
  /**
13
13
  * Normalize the given path string,
@@ -40,7 +40,7 @@ function pathtoRegexp(path, keys, options) {
40
40
  if (path instanceof RegExp) {
41
41
  while (m = MATCHING_GROUP_REGEXP.exec(path.source)) {
42
42
  keys.push({
43
- name: name++,
43
+ name: m[1] || name++,
44
44
  optional: false,
45
45
  offset: m.index
46
46
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "path-to-regexp",
3
3
  "description": "Express style path to RegExp utility",
4
- "version": "0.1.7",
4
+ "version": "0.1.8",
5
5
  "files": [
6
6
  "index.js",
7
7
  "LICENSE"
package/History.md DELETED
@@ -1,36 +0,0 @@
1
- 0.1.7 / 2015-07-28
2
- ==================
3
-
4
- * Fixed regression with escaped round brackets and matching groups.
5
-
6
- 0.1.6 / 2015-06-19
7
- ==================
8
-
9
- * Replace `index` feature by outputting all parameters, unnamed and named.
10
-
11
- 0.1.5 / 2015-05-08
12
- ==================
13
-
14
- * Add an index property for position in match result.
15
-
16
- 0.1.4 / 2015-03-05
17
- ==================
18
-
19
- * Add license information
20
-
21
- 0.1.3 / 2014-07-06
22
- ==================
23
-
24
- * Better array support
25
- * Improved support for trailing slash in non-ending mode
26
-
27
- 0.1.0 / 2014-03-06
28
- ==================
29
-
30
- * add options.end
31
-
32
- 0.0.2 / 2013-02-10
33
- ==================
34
-
35
- * Update to match current express
36
- * add .license property to component.json