Skip to content

Commit 0ea5fa4

Browse files
committed
fix only substring if there is a plus
1 parent a1f8c1c commit 0ea5fa4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/getPackageResolution.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export function getPackageResolution({
3535
resolve(appPath, packageDetails.path),
3636
"package.json",
3737
)).version as string
38-
const installedVersion = installedVersionLong.substring(0, installedVersionLong.indexOf('+'))
38+
const indexOfPlus = installedVersionLong.indexOf('+');
39+
const installedVersion = indexOfPlus === 0 ? installedVersionLong : installedVersionLong.substring(0, indexOfPlus)
3940

4041
const entries = Object.entries(appLockFile.object).filter(
4142
([k, v]) =>

0 commit comments

Comments
 (0)