Skip to content

Commit

Permalink
chore: to prevent a edge case that the injected dependency is not sta…
Browse files Browse the repository at this point in the history
…rt with file
  • Loading branch information
g-chao committed May 9, 2024
1 parent 605b75f commit f0fb1b3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/pnpm-sync-lib/src/pnpmSyncPrepare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,11 @@ function processDependencies(
for (const [dependency, specifier] of Object.entries(dependencies)) {
if (injectedDependencyToVersion.has(dependency)) {
const specifierToUse: string = typeof specifier === 'string' ? specifier : specifier.version;
injectedDependencyToVersion.get(dependency)?.add(specifierToUse);

// the injected dependency should always start with file protocol
if (specifierToUse.startsWith('file:')) {
injectedDependencyToVersion.get(dependency)?.add(specifierToUse);
}
}
}
}
Expand Down

0 comments on commit f0fb1b3

Please sign in to comment.