File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -302,8 +302,12 @@ export class ToolsNormalizer extends BaseJsonNormalizer<Models.Tools> {
302302 ) ) , options )
303303 }
304304 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
307311 }
308312 }
309313}
Original file line number Diff line number Diff line change @@ -120,8 +120,8 @@ export namespace Normalized {
120120
121121 /** since CDX 1.5 */
122122 export interface Tools {
123- components : Component [ ]
124- services : Service [ ]
123+ components ? : Component [ ]
124+ services ? : Service [ ]
125125 }
126126
127127 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> {
389389 children : this . _factory . makeForComponent ( ) . normalizeIterable ( data . components , options , 'component' )
390390 } )
391391 }
392- if ( data . components . size > 0 ) {
392+ if ( data . services . size > 0 ) {
393393 children . push ( {
394394 type : 'element' ,
395395 name : 'services' ,
You can’t perform that action at this time.
0 commit comments