Skip to content

Commit 597b648

Browse files
committed
Somewhat nicer handling of completely unrecognized URLs
1 parent 02e4ead commit 597b648

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/module-registries.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ export function determineModuleBase(fullUrl: string, opts: RegistryOpts): string
8080
const verIdx = parts.findIndex(x => x.includes('@'))
8181
return parts.slice(0, verIdx+1).join('/');
8282
}
83-
return fullUrl;
83+
// If we really don't recognize anything in the URL, we just cut it off arbitrarily
84+
return parts.slice(0, 4).join('/');
8485
}
8586

8687
export function determineModuleLabel(module: CodeModule, opts: RegistryOpts): string[] {

0 commit comments

Comments
 (0)