Working toward an openly accessable registry
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Fabian Stamm
2020-08-02 22:33:18 +02:00
parent 855034f14d
commit 4aaee3e419
8 changed files with 64 additions and 18 deletions

View File

@ -64,6 +64,7 @@ export const basicauth = (realm: string) => (next: ABC.HandlerFunc) => (
export function extractPackagePath(path: string): [string, string | undefined] {
let packageName = "";
path = path.toLowerCase();
if (path.startsWith("@")) {
packageName = "@";
path = path.slice(1);
@ -81,7 +82,6 @@ export function extractPackagePath(path: string): [string, string | undefined] {
if (packageVersion !== "") {
if (!isValidVersion(packageVersion))
throw new Error("Invalid package version!");
else packageVersion = undefined;
}
return [packageName, packageVersion];