@@ -243,11 +243,13 @@ export class BomBuilder {
243243 : [ path . win32 . relative , '\\' , / \\ / g]
244244 /* eslint-enable @typescript-eslint/unbound-method */
245245 allComponents . forEach ( ( c , p ) => {
246+ /* eslint-disable no-param-reassign -- intended */
246247 c . purl = this . makePurl ( c )
247248 c . properties . add ( new Models . Property (
248249 PropertyNames . PackageInstallPath ,
249250 relativePath ( rootPath , p ) . replace ( dirSepRE , '/' )
250251 ) )
252+ /* eslint-enable no-param-reassign */
251253 } )
252254
253255 const pTree = this . treeBuilder . fromPaths ( rootPath , allComponents . keys ( ) , dirSep )
@@ -315,7 +317,7 @@ export class BomBuilder {
315317 parts . push ( '@' , component . version )
316318 }
317319 const bRefD = parts . join ( '' )
318- const bRefC = bRefCs [ bRefD ] = ( bRefCs [ bRefD ] ?? 0 ) + 1
320+ const bRefC = bRefCs [ bRefD ] = ( bRefCs [ bRefD ] ?? 0 ) + 1 /* eslint-disable-line no-multi-assign -- ack */
319321 component . bomRef . value = `${ pref } ${ bRefD } ${ bRefC > 1 ? '#' + bRefC : '' } `
320322 this . setNestedBomRefs ( allComponents , cTree , `${ component . bomRef . value } |` )
321323 }
@@ -404,30 +406,32 @@ export class BomBuilder {
404406 }
405407
406408 component . licenses . forEach ( l => {
409+ /* eslint-disable no-param-reassign -- intended */
407410 l . acknowledgement = Enums . LicenseAcknowledgement . Declared
408- } )
411+ /* eslint-enable no-param-reassign */
412+ } )
409413
410- if ( this . gatherLicenseTexts ) {
411- component . evidence = new Models . ComponentEvidence ( )
412- for ( const le of this . fetchLicenseEvidence ( ppath ) ) {
413- component . evidence . licenses . add ( le )
414- }
415- }
414+ if ( this . gatherLicenseTexts ) {
415+ component . evidence = new Models . ComponentEvidence ( )
416+ for ( const le of this . fetchLicenseEvidence ( ppath ) ) {
417+ component . evidence . licenses . add ( le )
418+ }
419+ }
416420
417- // region properties
421+ // region properties
418422
419- if ( manifest . private === true ) {
420- component . properties . add (
421- new Models . Property ( PropertyNames . PackagePrivate , PropertyValueBool . True )
422- )
423- }
423+ if ( manifest . private === true ) {
424+ component . properties . add (
425+ new Models . Property ( PropertyNames . PackagePrivate , PropertyValueBool . True )
426+ )
427+ }
424428
425- // endregion properties
429+ // endregion properties
426430
427- return component
428- }
431+ return component
432+ }
429433
430- /* eslint-disable-next-line complexity -- ack */
434+ /* eslint-disable-next-line complexity -- ack */
431435 private makeComponentWithPackageData ( data : PackageData , ppath : PackagePath , type : Enums . ComponentType = Enums . ComponentType . Library ) : Models . Component {
432436 const isOptional = data . optional === true || data . devOptional === false
433437 let isExcluded = false
@@ -462,49 +466,51 @@ export class BomBuilder {
462466 component = new DummyComponent ( type , ppath )
463467 } else {
464468 component . licenses . forEach ( l => {
469+ /* eslint-disable no-param-reassign -- intended */
465470 l . acknowledgement = Enums . LicenseAcknowledgement . Declared
466- } )
467- }
468-
469- if ( isExcluded ) {
470- component . scope = Enums . ComponentScope . Excluded
471- } else if ( isOptional ) {
472- component . scope = Enums . ComponentScope . Optional
473- }
474-
475- // region properties
476- if ( data . dev === true || data . devOptional === true ) {
477- component . properties . add (
478- new Models . Property ( PropertyNames . PackageDevelopment , PropertyValueBool . True )
479- )
480- }
481- if ( data . extraneous === true ) {
482- component . properties . add (
483- new Models . Property ( PropertyNames . PackageExtraneous , PropertyValueBool . True )
484- )
485- }
486- if ( data . inBundle === true ) {
487- component . properties . add (
488- new Models . Property ( PropertyNames . PackageBundled , PropertyValueBool . True )
489- )
490- }
491- // endregion properties
492-
493- // region resolved
494- const rref = this . makeExtRefDistFromPackageData ( data )
495- if ( rref !== undefined ) {
496- component . externalReferences . add ( rref )
497- }
498- // endregion resolved
499-
500- return component
501- }
502-
503- /**
504- * Ignore pattern for `resolved`.
505- * - ignore: well, just ignore it ... i guess.
506- * - file: local dist cannot be shipped and therefore should be ignored.
507- */
471+ /* eslint-enable no-param-reassign */
472+ } )
473+ }
474+
475+ if ( isExcluded ) {
476+ component . scope = Enums . ComponentScope . Excluded
477+ } else if ( isOptional ) {
478+ component . scope = Enums . ComponentScope . Optional
479+ }
480+
481+ // region properties
482+ if ( data . dev === true || data . devOptional === true ) {
483+ component . properties . add (
484+ new Models . Property ( PropertyNames . PackageDevelopment , PropertyValueBool . True )
485+ )
486+ }
487+ if ( data . extraneous === true ) {
488+ component . properties . add (
489+ new Models . Property ( PropertyNames . PackageExtraneous , PropertyValueBool . True )
490+ )
491+ }
492+ if ( data . inBundle === true ) {
493+ component . properties . add (
494+ new Models . Property ( PropertyNames . PackageBundled , PropertyValueBool . True )
495+ )
496+ }
497+ // endregion properties
498+
499+ // region resolved
500+ const rref = this . makeExtRefDistFromPackageData ( data )
501+ if ( rref !== undefined ) {
502+ component . externalReferences . add ( rref )
503+ }
504+ // endregion resolved
505+
506+ return component
507+ }
508+
509+ /**
510+ * Ignore pattern for `resolved`.
511+ * - ignore: well, just ignore it ... i guess.
512+ * - file: local dist cannot be shipped and therefore should be ignored.
513+ */
508514 private readonly resolvedRE_ignore = / ^ (?: i g n o r e | f i l e ) : / i
509515
510516 private makeExtRefDistFromPackageData ( data : PackageData ) : Models . ExternalReference | undefined {
@@ -603,7 +609,7 @@ type PTreeI = Iterable<[PackagePath, PTree]>
603609
604610export class TreeBuilder {
605611 fromPaths ( root : PackagePath , paths : Iterable < PackagePath > , dirSeparator : string ) : PTree {
606- root += dirSeparator
612+ root += dirSeparator /* eslint-disable-line no-param-reassign -- ack */
607613 const upaths = new Set < PackagePath > ( iterableMap ( paths , p => `${ p } ${ dirSeparator } ` ) )
608614 const outs = new Set < PackagePath > ( iterableFilter ( upaths , p => ! p . startsWith ( root ) ) )
609615 /* eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- ack */
0 commit comments