Skip to content

Commit

Permalink
fix(core): fix original key mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Mar 30, 2023
1 parent 09f45ec commit 7aa7fc7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/nx/src/plugins/js/lock-file/pnpm-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,10 @@ function findOriginalKeys(
const snapshot = packages[key];
// standard package
if (key.startsWith(`/${packageName}/${version}`)) {
matchedKeys.push([returnFullKey ? key : key.split('/').pop(), snapshot]);
matchedKeys.push([
returnFullKey ? key : key.slice(packageName.length + 2),
snapshot,
]);
}
// tarball package
if (key === version) {
Expand All @@ -209,8 +212,8 @@ function findOriginalKeys(
if (
version.startsWith('npm:') &&
key.startsWith(
`/${version.slice(4, version.lastIndexOf('@'))}/${version.slice(
version.lastIndexOf('@') + 1
`/${version.slice(4, version.indexOf('@', 6))}/${version.slice(
version.indexOf('@', 6) + 1
)}`
)
) {
Expand Down

0 comments on commit 7aa7fc7

Please sign in to comment.