Skip to content

Commit

Permalink
Somewhat nicer handling of completely unrecognized URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
danopia committed May 18, 2024
1 parent 02e4ead commit 597b648
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/module-registries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ export function determineModuleBase(fullUrl: string, opts: RegistryOpts): string
const verIdx = parts.findIndex(x => x.includes('@'))
return parts.slice(0, verIdx+1).join('/');
}
return fullUrl;
// If we really don't recognize anything in the URL, we just cut it off arbitrarily
return parts.slice(0, 4).join('/');
}

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

0 comments on commit 597b648

Please sign in to comment.