@@ -99,14 +99,13 @@ function onlyDifferInQualifiers(firstPurl, secondPurl) {
99
99
* differ only in qualifiers to the first URL
100
100
*
101
101
* @param {Array<string> | undefined } purls PURLs to check
102
- * @return {Array<string > } indexes of the PURLs that differ
102
+ * @return {Array<number > } indexes of the PURLs that differ
103
103
*/
104
104
export function checkPurls ( purls ) {
105
+ /** @type {Array<number> }*/
105
106
const invalidPurls = [ ]
106
107
if ( purls ) {
107
- /**
108
- * @type {Array<PackageURL | null> }
109
- */
108
+ /** @type {Array<PackageURL | null> } */
110
109
const packageUrls = purls . map ( ( purl ) => {
111
110
try {
112
111
return PackageURL . fromString ( purl )
@@ -124,7 +123,7 @@ export function checkPurls(purls) {
124
123
for ( let i = 1 ; i < packageUrls . length ; i ++ ) {
125
124
const packageUrl = packageUrls [ i ]
126
125
if ( ! packageUrl || ! onlyDifferInQualifiers ( firstPurls , packageUrl ) ) {
127
- invalidPurls . push ( '' + i )
126
+ invalidPurls . push ( i )
128
127
}
129
128
}
130
129
}
@@ -191,7 +190,7 @@ export function mandatoryTest_6_1_42(doc) {
191
190
ctx . isValid = false
192
191
ctx . errors . push ( {
193
192
instancePath : `${ prefix } /product_identification_helper/purls/${ invalidPurlIndex } ` ,
194
- message : `The PURL differs to the first PURL not only in qualifiers` ,
193
+ message : 'the PURL differs to the first PURL not only in qualifiers' ,
195
194
} )
196
195
} )
197
196
}
@@ -212,7 +211,7 @@ export function mandatoryTest_6_1_42(doc) {
212
211
ctx . isValid = false
213
212
ctx . errors . push ( {
214
213
instancePath : `${ prefix } /product/product_identification_helper/purls/${ invalidPurlIndex } ` ,
215
- message : `The PURL differs to the first PURL not only in qualifiers` ,
214
+ message : 'the PURL differs to the first PURL not only in qualifiers' ,
216
215
} )
217
216
} )
218
217
branch . branches ?. forEach ( ( branch , index ) => {
0 commit comments