Skip to content

Commit 2573228

Browse files
committed
Fix getPackageName helper
1 parent a5a9812 commit 2573228

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/utils/packages.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ const cjsPluginSuffixRegExp =
2222

2323
function getPackageName(string, start = 0) {
2424
const end = getPackageNameEnd(string, start)
25-
return end === string.length ? string : string.slice(0, end)
25+
const name = string.slice(start, end)
26+
return isValidPackageName(name) ? name : ''
2627
}
2728

2829
function getPackageNameEnd(string, start = 0) {

0 commit comments

Comments
 (0)