Skip to content

Commit

Permalink
fix: adjust package name in case of wrong casing
Browse files Browse the repository at this point in the history
  • Loading branch information
smellai committed Oct 5, 2022
1 parent 6a9b798 commit 5879511
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/readPackageJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@ export const readPackageJson = async (
Buffer.from(data.content, data.encoding as BufferEncoding).toString()
);

const libVersionDep = pkg.dependencies?.[pkgName];
const libVersionPeer = pkg.peerDependencies?.[pkgName];
const libVersionDev = pkg.devDependencies?.[pkgName];
const libVersionDep =
pkg.dependencies?.[pkgName] ||
pkg.dependencies?.[pkgName.toLocaleLowerCase()];
const libVersionPeer =
pkg.peerDependencies?.[pkgName] ||
pkg.peerDependencies?.[pkgName.toLocaleLowerCase()];
const libVersionDev =
pkg.devDependencies?.[pkgName] ||
pkg.devDependencies?.[pkgName.toLocaleLowerCase()];

const libVersion = libVersionDep || libVersionPeer || libVersionDev;
if (libVersion) {
Expand Down

0 comments on commit 5879511

Please sign in to comment.