magnet-uri
Advanced tools
Comparing version 4.2.0 to 4.2.1
12
index.js
@@ -37,4 +37,5 @@ module.exports = magnetURIDecode | ||
// URIs, so decode them | ||
if (key === 'tr' || key === 'xs' || key === 'as' || key === 'ws') | ||
if (key === 'tr' || key === 'xs' || key === 'as' || key === 'ws') { | ||
val = decodeURIComponent(val) | ||
} | ||
@@ -83,6 +84,8 @@ // Return keywords as an array | ||
result.urlList = [] | ||
if (typeof result.as === 'string' || Array.isArray(result.as)) | ||
if (typeof result.as === 'string' || Array.isArray(result.as)) { | ||
result.urlList = result.urlList.concat(result.as) | ||
if (typeof result.ws === 'string' || Array.isArray(result.ws)) | ||
} | ||
if (typeof result.ws === 'string' || Array.isArray(result.ws)) { | ||
result.urlList = result.urlList.concat(result.ws) | ||
} | ||
@@ -118,4 +121,5 @@ return result | ||
if (key === 'dn') val = encodeURIComponent(val).replace(/%20/g, '+') | ||
if (key === 'tr' || key === 'xs' || key === 'as' || key === 'ws') | ||
if (key === 'tr' || key === 'xs' || key === 'as' || key === 'ws') { | ||
val = encodeURIComponent(val) | ||
} | ||
if (key === 'kt') val = encodeURIComponent(val) | ||
@@ -122,0 +126,0 @@ |
{ | ||
"name": "magnet-uri", | ||
"description": "Parse a magnet URI and return an object of keys/values", | ||
"version": "4.2.0", | ||
"version": "4.2.1", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Feross Aboukhadijeh", |
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
109635
9
286