File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -202,10 +202,11 @@ export function transformPackageName(
202202 return "" ;
203203 } else if ( packageName . startsWith ( "@" ) ) {
204204 const [ first , ...rest ] = packageName . split ( "/" ) ;
205+ assert ( rest . length > 0 , `Invalid scoped package name (${ packageName } )` ) ;
205206 if ( strategy === "strip" ) {
206207 return escapePath ( rest . join ( "/" ) ) ;
207208 } else {
208- // Stripping away the @ and using double underscore to separate scope and name is common practice other projects (like DefinitelyTyped)
209+ // Stripping away the @ and using double underscore to separate scope and name is common practice in other projects (like DefinitelyTyped)
209210 return escapePath ( `${ first . replace ( / ^ @ / , "" ) } __${ rest . join ( "/" ) } ` ) ;
210211 }
211212 } else {
You can’t perform that action at this time.
0 commit comments