mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Fix yarn URL issue
This commit is contained in:
parent
db31fa9f41
commit
a53fc736e9
2 changed files with 6 additions and 2 deletions
|
|
@ -127,6 +127,10 @@ describe("npmInterceptor", async () => {
|
||||||
url: "https://registry.yarnpkg.com/@babel/core/-/core-7.21.4.tgz",
|
url: "https://registry.yarnpkg.com/@babel/core/-/core-7.21.4.tgz",
|
||||||
expected: { packageName: "@babel/core", version: "7.21.4" },
|
expected: { packageName: "@babel/core", version: "7.21.4" },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
url: "https://registry.yarnpkg.com/@music-i18n%2fverovio/-/verovio-1.4.1.tgz",
|
||||||
|
expected: { packageName: "@music-i18n/verovio", version: "1.4.1" },
|
||||||
|
},
|
||||||
// URL to get package info, not tarball
|
// URL to get package info, not tarball
|
||||||
{
|
{
|
||||||
url: "https://registry.npmjs.org/lodash",
|
url: "https://registry.npmjs.org/lodash",
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,9 @@ export function parseNpmPackageUrl(url, registry) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const registryIndex = urlWithoutParams.indexOf(registry);
|
const registryIndex = urlWithoutParams.indexOf(registry);
|
||||||
const afterRegistry = urlWithoutParams.substring(
|
const afterRegistry = decodeURIComponent(urlWithoutParams.substring(
|
||||||
registryIndex + registry.length + 1
|
registryIndex + registry.length + 1
|
||||||
); // +1 to skip the slash
|
)); // +1 to skip the slash
|
||||||
|
|
||||||
const separatorIndex = afterRegistry.indexOf("/-/");
|
const separatorIndex = afterRegistry.indexOf("/-/");
|
||||||
if (separatorIndex === -1) {
|
if (separatorIndex === -1) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue