Comparing version 1.0.0 to 1.0.1
@@ -65,12 +65,14 @@ function splitPath (path) { | ||
for (i = 0; i < il; i += 1) { | ||
match = compareSegments(routeSegments[i], requestSegments[i]); | ||
match = compareSegments(routeSegments[i], requestSegments[i]); | ||
if (typeof match === "object") { | ||
req.params = {}; | ||
req.params[match.key] = match.value; | ||
} else if (!match) { | ||
delete req.params | ||
return; | ||
} | ||
if (typeof match === "object") { | ||
req.params = {}; | ||
req.params[match.key] = match.value; | ||
} else if (!match) { | ||
delete req.params | ||
return; | ||
} | ||
if (i === il-1 && match) { | ||
req.match = routeSegments.join("/"); | ||
} | ||
} | ||
@@ -77,0 +79,0 @@ }); |
{ | ||
"name": "overalls", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Decorate HTTP requests with path parameters", | ||
@@ -24,3 +24,3 @@ "main": "index.js", | ||
"author": "William Fisher", | ||
"license": "ISC", | ||
"license": "MIT", | ||
"bugs": { | ||
@@ -27,0 +27,0 @@ "url": "https://github.com/FilWisher/overalls/issues" |
@@ -9,3 +9,3 @@ # overalls | ||
##### Use: | ||
##### use: | ||
```js | ||
@@ -50,3 +50,3 @@ var http = require("http"); | ||
## API | ||
## api | ||
@@ -90,1 +90,5 @@ overalls exposes a single function: | ||
``` | ||
## license | ||
MIT |
@@ -128,2 +128,3 @@ var test = require("tape"); | ||
t.ok(req.hasOwnProperty("params"), "req decorated with params property"); | ||
t.equals(req.params.issue, "first", "req.params has correct values"); | ||
@@ -130,0 +131,0 @@ t.end(); |
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
13717
10
250
92