@polka/url
Advanced tools
Comparing version 1.0.0-next.18 to 1.0.0-next.19
@@ -11,3 +11,3 @@ const qs = require('querystring'); | ||
* @property {string} url | ||
* @property {boolean} _decoded | ||
* @property {string} _decoded | ||
* @property {ParsedURL} _parsedUrl | ||
@@ -42,5 +42,6 @@ */ | ||
if (!!toDecode && encoded) { | ||
req._decoded = true; | ||
if (pathname.indexOf('%') !== -1) { | ||
try { pathname = decodeURIComponent(pathname) } | ||
if (pathname.indexOf('%') === -1) { | ||
req._decoded = pathname; | ||
} else { | ||
try { pathname = req._decoded = decodeURIComponent(pathname) } | ||
catch (e) { /* URI malformed */ } | ||
@@ -47,0 +48,0 @@ } |
{ | ||
"version": "1.0.0-next.18", | ||
"version": "1.0.0-next.19", | ||
"name": "@polka/url", | ||
@@ -29,3 +29,3 @@ "repository": "lukeed/polka", | ||
}, | ||
"gitHead": "765e0b2e888f210b869e9584b31af6e876ccfdc4" | ||
"gitHead": "6ac64983eeb35a67c483949e08f356e46569803c" | ||
} |
@@ -53,3 +53,3 @@ # @polka/url [![npm](https://badgen.now.sh/npm/v/@polka/url)](https://npmjs.org/package/@polka/url) | ||
// Attaches awareness key | ||
assert(req._decoded); //=> true | ||
assert(req._decoded); //=> '/føøß∂r' | ||
``` | ||
@@ -83,3 +83,3 @@ | ||
Additionally, the `req` is mutated with `req._decoded = true` so as to prevent repetitive decoding. | ||
Additionally, the `req` is mutated with `req._decoded` so as to prevent repetitive decoding. | ||
@@ -86,0 +86,0 @@ |
Sorry, the diff of this file is not supported yet
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
7292
92