File tree 3 files changed +27
-2
lines changed
3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change
1
+ name : Run Unit Tests
2
+ on :
3
+ pull_request :
4
+ branches :
5
+ - ' **'
6
+ jobs :
7
+ unit_test :
8
+ runs-on : ubuntu-latest
9
+ steps :
10
+ - uses : actions/checkout@v2
11
+ - run : |
12
+ npm ci
13
+ npm run test
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ class PackageURL {
104
104
105
105
if ( this . version ) {
106
106
purl . push ( '@' ) ;
107
- purl . push ( encodeURIComponent ( this . version ) . replace ( / % 3 A / g, ':' ) ) ;
107
+ purl . push ( encodeURIComponent ( this . version ) . replace ( / % 3 A / g, ':' ) . replace ( / % 2 B / g , '+' ) ) ;
108
108
}
109
109
110
110
if ( this . qualifiers ) {
@@ -188,7 +188,7 @@ class PackageURL {
188
188
// Convert percent-encoded colons (:) back, to stay in line with the `toString`
189
189
// implementation of this library.
190
190
// https://github.com/package-url/packageurl-js/blob/58026c86978c6e356e5e07f29ecfdccbf8829918/src/package-url.js#L98C10-L98C10
191
- let versionEncoded = encodeURIComponent ( version ) . replace ( / % 3 A / g, ':' ) ;
191
+ let versionEncoded = encodeURIComponent ( version ) . replace ( / % 3 A / g, ':' ) . replace ( / % 2 B / g , '+' ) ;
192
192
193
193
if ( rawVersion !== versionEncoded ) {
194
194
throw new Error ( 'Invalid purl: version must be percent-encoded' ) ;
Original file line number Diff line number Diff line change 107
107
"subpath" : null ,
108
108
"is_invalid" : false
109
109
},
110
+ {
111
+ "description" : " debian can have debian versions as part of version with plus sign" ,
112
+ "purl" : " pkg:deb/debian/libssl1.1@1.1.1n-0+deb10u3?arch=amd64&distro=debian-10" ,
113
+ "canonical_purl" : " pkg:deb/debian/libssl1.1@1.1.1n-0+deb10u3?arch=amd64&distro=debian-10" ,
114
+ "type" : " deb" ,
115
+ "namespace" : " debian" ,
116
+ "name" : " libssl1.1" ,
117
+ "version" : " 1.1.1n-0+deb10u3" ,
118
+ "qualifiers" : {"arch" : " amd64" , "distro" : " debian-10" },
119
+ "subpath" : null ,
120
+ "is_invalid" : false
121
+ },
110
122
{
111
123
"description" : " docker uses qualifiers and hash image id as versions" ,
112
124
"purl" : " pkg:docker/customer/dockerimage@sha256:244fd47e07d1004f0aed9c?repository_url=gcr.io" ,
You can’t perform that action at this time.
0 commit comments