fix: ignore case, when verifying package name in the store (#4368)

close #4367
This commit is contained in:
Zoltan Kochan
2022-02-21 22:56:04 +02:00
parent 5f00eb0e03
commit 800fb2836c
3 changed files with 29 additions and 1 deletions

View File

@@ -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).

View File

@@ -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 &&

View File

@@ -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 () => {