Re-organize package URL parsing

This commit is contained in:
MICHAEL JACKSON
2017-08-19 11:44:01 -07:00
parent 17f6a6bbe9
commit 066729f17c
7 changed files with 29 additions and 31 deletions

View File

@ -0,0 +1,16 @@
function createPackageURL(packageName, version, filename, search) {
let pathname = `/${packageName}`
if (version != null)
pathname += `@${version}`
if (filename)
pathname += filename
if (search)
pathname += search
return pathname
}
module.exports = createPackageURL