Comparing version 1.1.1 to 1.1.2
@@ -0,1 +1,6 @@ | ||
1.1.2 / 2014-07-08 | ||
================== | ||
* Seriously fix Node.js 0.8 compatibility | ||
1.1.1 / 2014-07-08 | ||
@@ -2,0 +7,0 @@ ================== |
22
index.js
@@ -29,3 +29,3 @@ | ||
if (typeof parsed === 'object' && parsed instanceof Url && parsed.href === req.url) { | ||
if (fresh(req, parsed)) { | ||
return parsed | ||
@@ -60,3 +60,5 @@ } | ||
if (simplePath) { | ||
var url = new Url() | ||
var url = Url !== undefined | ||
? new Url() | ||
: {} | ||
url.path = str | ||
@@ -77,1 +79,17 @@ url.href = str | ||
} | ||
/** | ||
* Determine if parsed is still fresh for req. | ||
* | ||
* @param {ServerRequest} req | ||
* @param {object} parsedUrl | ||
* @return {boolean} | ||
* @api private | ||
*/ | ||
function fresh(req, parsedUrl) { | ||
return typeof parsedUrl === 'object' | ||
&& parsedUrl !== null | ||
&& (Url === undefined || parsedUrl instanceof Url) | ||
&& parsed.href === req.url | ||
} |
{ | ||
"name": "parseurl", | ||
"description": "parse a url with memoization", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Jonathan Ong", |
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
4549
74