File tree 4 files changed +11
-6
lines changed
4 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ All notable changes to this project will be documented in this file.
13
13
* Static function ` Models.Tool.fromComponent() ` (via [ #1163 ] )
14
14
* Static function ` Models.Tool.fromService() ` (via [ #1163 ] )
15
15
* New class ` Models.Tools ` ([ #1152 ] via [ #1163 ] )
16
- * New serialization/normalization for ` Models.Tools ` ([ #1152 ] via [ #1163 ] )
16
+ * New serialization/normalization for ` Models.Tools ` ([ #1152 ] via [ #1163 ] , [ # 1180 ] )
17
17
* Changed
18
18
* Serializers and ` Bom ` -Normalizers will take changed ` Models.Bom.tools ` into account ([ #1152 ] via [ #1163 ] )
19
19
* Dependencies
@@ -24,6 +24,7 @@ All notable changes to this project will be documented in this file.
24
24
[ #1152 ] : https://github.com/CycloneDX/cyclonedx-javascript-library/issues/1152
25
25
[ #1163 ] : https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1163
26
26
[ #1173 ] : https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1173
27
+ [ #1180 ] : https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1180
27
28
28
29
## 6.13.0 -- 2024-11-18
29
30
Original file line number Diff line number Diff line change @@ -302,8 +302,12 @@ export class ToolsNormalizer extends BaseJsonNormalizer<Models.Tools> {
302
302
) ) , options )
303
303
}
304
304
return {
305
- components : this . _factory . makeForComponent ( ) . normalizeIterable ( data . components , options ) ,
306
- services : this . _factory . makeForService ( ) . normalizeIterable ( data . services , options )
305
+ components : data . components . size > 0
306
+ ? this . _factory . makeForComponent ( ) . normalizeIterable ( data . components , options )
307
+ : undefined ,
308
+ services : data . services . size > 0
309
+ ? this . _factory . makeForService ( ) . normalizeIterable ( data . services , options )
310
+ : undefined
307
311
}
308
312
}
309
313
}
Original file line number Diff line number Diff line change @@ -120,8 +120,8 @@ export namespace Normalized {
120
120
121
121
/** since CDX 1.5 */
122
122
export interface Tools {
123
- components : Component [ ]
124
- services : Service [ ]
123
+ components ? : Component [ ]
124
+ services ? : Service [ ]
125
125
}
126
126
127
127
export type ToolsType = Tools | Tool [ ]
Original file line number Diff line number Diff line change @@ -389,7 +389,7 @@ export class ToolsNormalizer extends BaseXmlNormalizer<Models.Tools> {
389
389
children : this . _factory . makeForComponent ( ) . normalizeIterable ( data . components , options , 'component' )
390
390
} )
391
391
}
392
- if ( data . components . size > 0 ) {
392
+ if ( data . services . size > 0 ) {
393
393
children . push ( {
394
394
type : 'element' ,
395
395
name : 'services' ,
You can’t perform that action at this time.
0 commit comments