Fix failing test

This commit is contained in:
MICHAEL JACKSON
2017-08-12 09:40:53 -07:00
parent 99c1f7098a
commit 4653ee9e42
2 changed files with 9 additions and 9 deletions

View File

@ -3,11 +3,15 @@ const url = require('url')
const URLFormat = /^\/((?:@[^\/@]+\/)?[^\/@]+)(?:@([^\/]+))?(\/.*)?$/
function decodeParam(param) {
try {
return decodeURIComponent(param)
} catch (error) {
return null
if (param) {
try {
return decodeURIComponent(param)
} catch (error) {
// Ignore invalid params.
}
}
return ''
}
function parsePackageURL(packageURL) {