File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -54,18 +54,13 @@ export function isFromCdn(specifier: string): boolean {
5454}
5555
5656export function getFile ( specifier : string ) : string {
57- const result = parseNpm ( specifier ) || parseGh ( specifier ) ;
58- if ( ! result ) {
57+ if ( specifier . startsWith ( "npm:" ) ) {
58+ return specifier . replace ( "npm:" , "https://cdn.jsdelivr.net/npm/" ) ;
59+ } else if ( specifier . startsWith ( "gh:" ) ) {
60+ return specifier . replace ( "gh:" , "https://cdn.jsdelivr.net/gh/" ) ;
61+ } else {
5962 throw new Error ( `Invalid specifier: ${ specifier } ` ) ;
6063 }
61-
62- const [ type , name , version , filename ] = result ;
63-
64- if ( filename . includes ( "*" ) ) {
65- throw new Error ( `Specifier must not contain glob pattern: ${ specifier } ` ) ;
66- }
67-
68- return `https://cdn.jsdelivr.net/${ type } /${ name } @${ version } ${ filename } ` ;
6964}
7065
7166export async function getVersion (
You can’t perform that action at this time.
0 commit comments