Skip to content

Commit 1bf5e4a

Browse files
committed
Update implementation for spec changes
1 parent dea479f commit 1bf5e4a

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/encode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function encodeSubpath(subpath) {
5757

5858
function encodeVersion(version) {
5959
return isNonEmptyString(version)
60-
? encodeComponent(version).replace(/%3A/g, ':').replace(/%2B/g, '+')
60+
? encodeComponent(version).replace(/%3A/g, ':')
6161
: ''
6262
}
6363

src/validate.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ function validateType(type, throws) {
136136
return false
137137
}
138138
// The package type is composed only of ASCII letters and numbers,
139-
// '.', '+' and '-' (period, plus, and dash)
139+
// '.' (period), and '-' (dash).
140140
for (let i = 0, { length } = type; i < length; i += 1) {
141141
const code = type.charCodeAt(i)
142142
// biome-ignore format: newlines
@@ -147,7 +147,6 @@ function validateType(type, throws) {
147147
(code >= 65 && code <= 90) || // A-Z
148148
(code >= 97 && code <= 122) || // a-z
149149
code === 46 || // .
150-
code === 43 || // +
151150
code === 45
152151
) // -
153152
)

test/data/contrib-tests.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[
22
{
3-
"description": "debian can have debian versions as part of version with plus sign",
4-
"purl": "pkg:deb/debian/[email protected]+deb10u3?arch=amd64&distro=debian-10",
5-
"canonical_purl": "pkg:deb/debian/[email protected]+deb10u3?arch=amd64&distro=debian-10",
3+
"description": "debian versions with plus signs are percent-encoded",
4+
"purl": "pkg:deb/debian/[email protected]%2Bdeb10u3?arch=amd64&distro=debian-10",
5+
"canonical_purl": "pkg:deb/debian/[email protected]%2Bdeb10u3?arch=amd64&distro=debian-10",
66
"type": "deb",
77
"namespace": "debian",
88
"name": "libssl1.1",

0 commit comments

Comments
 (0)