@@ -99,14 +99,13 @@ function onlyDifferInQualifiers(firstPurl, secondPurl) {
9999 * differ only in qualifiers to the first URL
100100 *
101101 * @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
103103 */
104104export function checkPurls ( purls ) {
105+ /** @type {Array<number> }*/
105106 const invalidPurls = [ ]
106107 if ( purls ) {
107- /**
108- * @type {Array<PackageURL | null> }
109- */
108+ /** @type {Array<PackageURL | null> } */
110109 const packageUrls = purls . map ( ( purl ) => {
111110 try {
112111 return PackageURL . fromString ( purl )
@@ -124,7 +123,7 @@ export function checkPurls(purls) {
124123 for ( let i = 1 ; i < packageUrls . length ; i ++ ) {
125124 const packageUrl = packageUrls [ i ]
126125 if ( ! packageUrl || ! onlyDifferInQualifiers ( firstPurls , packageUrl ) ) {
127- invalidPurls . push ( '' + i )
126+ invalidPurls . push ( i )
128127 }
129128 }
130129 }
@@ -191,7 +190,7 @@ export function mandatoryTest_6_1_42(doc) {
191190 ctx . isValid = false
192191 ctx . errors . push ( {
193192 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' ,
195194 } )
196195 } )
197196 }
@@ -212,7 +211,7 @@ export function mandatoryTest_6_1_42(doc) {
212211 ctx . isValid = false
213212 ctx . errors . push ( {
214213 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' ,
216215 } )
217216 } )
218217 branch . branches ?. forEach ( ( branch , index ) => {
0 commit comments