Allow slashes in purl package names

This commit is contained in:
Justin Holguín
2024-05-02 19:07:02 +00:00
committed by GitHub
parent 0c155c5e85
commit 432d8e7efe
4 changed files with 37 additions and 4 deletions

10
dist/index.js generated vendored
View File

@@ -916,7 +916,10 @@ function parsePURL(purl) {
}
else {
result.namespace = decodeURIComponent(parts[1]);
namePlusRest = parts[2];
// Add back the '/'s to the rest of the parts, in case there are any more.
// This may violate the purl spec, but people do it and it can be parsed
// without ambiguity.
namePlusRest = parts.slice(2).join('/');
}
const name = namePlusRest.match(/([^@#?]+)[@#?]?.*/);
if (!result.namespace && !name) {
@@ -49945,7 +49948,10 @@ function parsePURL(purl) {
}
else {
result.namespace = decodeURIComponent(parts[1]);
namePlusRest = parts[2];
// Add back the '/'s to the rest of the parts, in case there are any more.
// This may violate the purl spec, but people do it and it can be parsed
// without ambiguity.
namePlusRest = parts.slice(2).join('/');
}
const name = namePlusRest.match(/([^@#?]+)[@#?]?.*/);
if (!result.namespace && !name) {

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long