Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

Bump packageurl-js from 1.1.1 to 1.2.1 #549

Merged
merged 2 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38755,11 +38755,20 @@ var require_package_url2 = __commonJS({
_handlePyPi() {
this.name = this.name.toLowerCase().replace(/_/g, "-");
}
_handlePub() {
this.name = this.name.toLowerCase();
if (!/^[a-z0-9_]+$/i.test(this.name)) {
throw new Error("Invalid purl: contains an illegal character.");
}
}
toString() {
var purl = ["pkg:", encodeURIComponent(this.type), "/"];
if (this.type === "pypi") {
this._handlePyPi();
}
if (this.type === "pub") {
this._handlePub();
}
if (this.namespace) {
purl.push(
encodeURIComponent(this.namespace).replace(/%3A/g, ":").replace(/%2F/g, "/")
Expand All @@ -38769,7 +38778,7 @@ var require_package_url2 = __commonJS({
purl.push(encodeURIComponent(this.name).replace(/%3A/g, ":"));
if (this.version) {
purl.push("@");
purl.push(encodeURIComponent(this.version).replace(/%3A/g, ":"));
purl.push(encodeURIComponent(this.version).replace(/%3A/g, ":").replace(/%2B/g, "+"));
}
if (this.qualifiers) {
purl.push("?");
Expand All @@ -38792,7 +38801,8 @@ var require_package_url2 = __commonJS({
if (!purl || typeof purl !== "string" || !purl.trim()) {
throw new Error("A purl string argument is required.");
}
let [scheme, remainder] = purl.split(":", 2);
let scheme = purl.slice(0, purl.indexOf(":"));
let remainder = purl.slice(purl.indexOf(":") + 1);
if (scheme !== "pkg") {
throw new Error('purl is missing the required "pkg" scheme component.');
}
Expand Down Expand Up @@ -38825,7 +38835,7 @@ var require_package_url2 = __commonJS({
let index = path.indexOf("@");
let rawVersion = path.substring(index + 1);
version2 = decodeURIComponent(rawVersion);
let versionEncoded = encodeURIComponent(version2).replace(/%3A/g, ":");
let versionEncoded = encodeURIComponent(version2).replace(/%3A/g, ":").replace(/%2B/g, "+");
if (rawVersion !== versionEncoded) {
throw new Error("Invalid purl: version must be percent-encoded");
}
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
"@github/dependency-submission-toolkit": "^1.2.10",
"packageurl-js": "^1.1.1",
"packageurl-js": "^1.2.1",
"zod": "^3.22.4"
},
"devDependencies": {
Expand Down
Loading