@@ -106,38 +106,32 @@ class Curation {
106106 /** @type {string[] } */
107107 const errors = [ ]
108108
109- Object . keys ( revisions )
110- . filter ( revision => revisions [ revision ] . licensed )
111- . forEach ( revision =>
112- sourceLicenseList . push ( {
113- source : `${ revision } licensed.declared` ,
114- license : revisions [ revision ] . licensed . declared
115- } )
116- )
117-
118- Object . keys ( revisions )
119- . filter ( revision => revisions [ revision ] . files )
120- . forEach ( revision => {
121- revisions [ revision ] . files . forEach (
122- /** @param {import('./curation').CurationFileEntry } file */ file => {
123- if ( file . license ) {
124- sourceLicenseList . push ( {
125- source : `${ file . path } in ${ revision } files` ,
126- license : file . license
127- } )
128- }
129- }
130- )
109+ for ( const revision of Object . keys ( revisions ) . filter ( revision => revisions [ revision ] . licensed ) ) {
110+ sourceLicenseList . push ( {
111+ source : `${ revision } licensed.declared` ,
112+ license : revisions [ revision ] . licensed . declared
131113 } )
114+ }
115+
116+ for ( const revision of Object . keys ( revisions ) . filter ( revision => revisions [ revision ] . files ) ) {
117+ for ( const /** @type {import('./curation').CurationFileEntry } */ file of revisions [ revision ] . files ) {
118+ if ( file . license ) {
119+ sourceLicenseList . push ( {
120+ source : `${ file . path } in ${ revision } files` ,
121+ license : file . license
122+ } )
123+ }
124+ }
125+ }
132126
133- sourceLicenseList . forEach ( ( { source, license } ) => {
127+ for ( const { source, license } of sourceLicenseList ) {
134128 const parsed = SPDX . normalize ( license )
135129 if ( ! parsed || parsed . includes ( 'NOASSERTION' ) ) {
136130 errors . push ( `${ source } with value "${ license } " is not SPDX compliant` )
137131 } else if ( parsed !== license ) {
138132 errors . push ( `${ source } with value "${ license } " is not normalized. Suggest using "${ parsed } "` )
139133 }
140- } )
134+ }
141135
142136 return {
143137 isCompliant : errors . length === 0 ,
0 commit comments