This commit is contained in:
MICHAEL JACKSON
2017-11-25 13:25:01 -08:00
parent f3974b5e2d
commit 3a309241da
64 changed files with 635 additions and 801 deletions

View File

@ -1,5 +1,5 @@
const url = require('url')
const validatePackageName = require('./validatePackageName')
const url = require("url")
const validatePackageName = require("./validatePackageName")
const URLFormat = /^\/((?:@[^\/@]+\/)?[^\/@]+)(?:@([^\/]+))?(\/.*)?$/
@ -12,7 +12,7 @@ function decodeParam(param) {
}
}
return ''
return ""
}
function parsePackageURL(packageURL) {
@ -28,7 +28,7 @@ function parsePackageURL(packageURL) {
// Disallow invalid npm package names.
if (!validatePackageName(packageName)) return null
const packageVersion = decodeParam(match[2]) || 'latest'
const packageVersion = decodeParam(match[2]) || "latest"
const filename = decodeParam(match[3])
return {