From 2d6c62a7913a84ea3ae2251e4ab19d4a4421f500 Mon Sep 17 00:00:00 2001 From: Fabian Stamm Date: Sun, 2 Aug 2020 22:39:05 +0200 Subject: [PATCH] Fixing path extraction --- registry/src/renderer.tsx | 1 - registry/src/utils.ts | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/src/renderer.tsx b/registry/src/renderer.tsx index 674e2d6..76e6aed 100644 --- a/registry/src/renderer.tsx +++ b/registry/src/renderer.tsx @@ -29,7 +29,6 @@ export default async function render( name: string, data: any ): Promise { - console.log(config); const component: { default: () => JSX.IntrinsicElements | Promise; } = await import(`./views/${name}.tsx`); diff --git a/registry/src/utils.ts b/registry/src/utils.ts index 33fa1d5..b34f821 100644 --- a/registry/src/utils.ts +++ b/registry/src/utils.ts @@ -74,7 +74,7 @@ export function extractPackagePath(path: string): [string, string | undefined] { if (parts.length > 2) throw new Error("Invalid package name!"); packageName += parts[0]; - let packageVersion: string | undefined = path[1]; + let packageVersion: string | undefined = parts[1]; if (!isValidPackageName(packageName)) throw new Error("Invalid package name!"); @@ -96,6 +96,7 @@ export async function getFile( version: string | null | undefined, file: string ): Promise<{ etag: string; data: Uint8Array } | null | undefined> { + console.log("Searching for file: %s/%s@%s", pkgName, file, version); const meta = await db.package.findOne({ name: pkgName }); if (!meta || meta.versions.length < 1) return null;