Prettier everything up

This commit is contained in:
MICHAEL JACKSON
2017-11-08 08:57:15 -08:00
parent f3e041ace6
commit 2d57d96e62
36 changed files with 785 additions and 577 deletions

View File

@ -1,14 +1,11 @@
function createPackageURL(packageName, version, filename, search) {
let pathname = `/${packageName}`
if (version != null)
pathname += `@${version}`
if (version != null) pathname += `@${version}`
if (filename)
pathname += filename
if (filename) pathname += filename
if (search)
pathname += search
if (search) pathname += search
return pathname
}

View File

@ -19,20 +19,20 @@ function parsePackageURL(packageURL) {
const match = URLFormat.exec(pathname)
if (match == null)
return null
if (match == null) return null
const packageName = match[1]
const packageVersion = decodeParam(match[2]) || 'latest'
const filename = decodeParam(match[3])
return { // If the URL is /@scope/name@version/file.js?main=browser:
pathname, // /@scope/name@version/path.js
search, // ?main=browser
query, // { main: 'browser' }
packageName, // @scope/name
return {
// If the URL is /@scope/name@version/file.js?main=browser:
pathname, // /@scope/name@version/path.js
search, // ?main=browser
query, // { main: 'browser' }
packageName, // @scope/name
packageVersion, // version
filename // /file.js
filename // /file.js
}
}