@@ -16,13 +16,16 @@ export default function mandatoryTest_6_1_13(doc) {
1616 /** @type {any } */ fullProductName ,
1717 /** @type {number } */ fullProductNameIndex
1818 ) => {
19- checkProductIdentificationHelperPURL ( fullProductName , ( errorMessage ) => {
20- isValid = false
21- errors . push ( {
22- instancePath : `/product_tree/full_product_names/${ fullProductNameIndex } /product_identification_helper/purl` ,
23- message : `invalid purl: ${ errorMessage } ` ,
24- } )
25- } )
19+ checkProductIdentificationHelperPURL (
20+ fullProductName ,
21+ ( errorMessage ) => {
22+ isValid = false
23+ errors . push ( {
24+ instancePath : `/product_tree/full_product_names/${ fullProductNameIndex } /product_identification_helper/purl` ,
25+ message : `invalid purl: ${ errorMessage } ` ,
26+ } )
27+ }
28+ )
2629 }
2730 )
2831 }
@@ -48,17 +51,20 @@ export default function mandatoryTest_6_1_13(doc) {
4851 }
4952
5053 if ( doc . product_tree ) {
51- checkBranchesForInvalidPURLs ( doc . product_tree , ( { branchIndexes, errorMessage } ) => {
52- isValid = false
53- const branchPathPart = branchIndexes . reduce (
54- ( str , index ) => `${ str } /branches/${ index } ` ,
55- '/product_tree'
56- )
57- errors . push ( {
58- instancePath : `${ branchPathPart } /product/product_identification_helper/purl` ,
59- message : `invalid purl: ${ errorMessage } ` ,
60- } )
61- } )
54+ checkBranchesForInvalidPURLs (
55+ doc . product_tree ,
56+ ( { branchIndexes, errorMessage } ) => {
57+ isValid = false
58+ const branchPathPart = branchIndexes . reduce (
59+ ( str , index ) => `${ str } /branches/${ index } ` ,
60+ '/product_tree'
61+ )
62+ errors . push ( {
63+ instancePath : `${ branchPathPart } /product/product_identification_helper/purl` ,
64+ message : `invalid purl: ${ errorMessage } ` ,
65+ } )
66+ }
67+ )
6268 }
6369
6470 return { errors, isValid }
@@ -100,6 +106,6 @@ const checkProductIdentificationHelperPURL = (productALike, onError) => {
100106 PackageURL . fromString ( productALike ?. product_identification_helper ?. purl )
101107 } catch ( e ) {
102108 const errorObject = /** @type {{message: string} } */ ( e )
103- onError ( errorObject ?. message ?? " Unknown purl error" )
109+ onError ( errorObject ?. message ?? ' Unknown purl error' )
104110 }
105111}
0 commit comments