Skip to content

Commit 7703963

Browse files
committed
Add fixes from code review
1 parent 3126195 commit 7703963

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/host/src/node/path-utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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 {

0 commit comments

Comments
 (0)