Skip to content

Commit

Permalink
fix: ignore case, when verifying package name in the store (#4368)
Browse files Browse the repository at this point in the history
close #4367
  • Loading branch information
zkochan committed Feb 21, 2022
1 parent 5f00eb0 commit 800fb28
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/brave-ties-begin.md
@@ -0,0 +1,6 @@
---
"@pnpm/package-requester": patch
"pnpm": patch
---

Ignore case, when verifying package name in the store [#4367](https://github.com/pnpm/pnpm/issues/4367).
2 changes: 1 addition & 1 deletion packages/package-requester/src/packageRequester.ts
Expand Up @@ -446,7 +446,7 @@ function fetchToStore (
(
pkgFilesIndex.name != null &&
opts.pkg.name != null &&
pkgFilesIndex.name !== opts.pkg.name
pkgFilesIndex.name.toLowerCase() !== opts.pkg.name.toLowerCase()
) ||
(
pkgFilesIndex.version != null &&
Expand Down
22 changes: 22 additions & 0 deletions packages/package-requester/test/index.ts
Expand Up @@ -943,6 +943,28 @@ test('throw exception if the package data in the store differs from the expected
})
await expect(files()).resolves.toStrictEqual(expect.anything())
}

{
const requestPackage = createPackageRequester({
resolve,
fetchers,
cafs,
networkConcurrency: 1,
storeDir,
verifyStoreIntegrity: true,
})
const { files } = requestPackage.fetchPackageToStore({
force: false,
lockfileDir: tempy.directory(),
pkg: {
name: 'IS-positive',
version: 'v1.0.0',
id: pkgResponse.body.id,
resolution: pkgResponse.body.resolution,
},
})
await expect(files()).resolves.toStrictEqual(expect.anything())
}
})

test('the version in the bundled manifest should be normalized', async () => {
Expand Down

0 comments on commit 800fb28

Please sign in to comment.