@@ -130,6 +130,16 @@ $common.formatTimestamp = function formatTimestamp(timestamp, includeTime) {
130130 }
131131} ;
132132
133+ /*
134+ * Concatenates the group, name, and version of a component.
135+ */
136+ $common . concatenateComponentName = function concatenateComponentName ( group , name , version ) {
137+ let g = $common . trimToNull ( group ) ;
138+ let n = $common . trimToNull ( name ) ;
139+ let v = $common . trimToNull ( version ) ;
140+ return ( g != null ? g + " " : "" ) + ( n != null ? n : "" ) + ( v != null ? " " + v : "" ) ;
141+ }
142+
133143/**
134144 * Helper function that returns the variable if it is not null, undefined, NaN,
135145 * an empty string (""), 0, or false. Otherwise, returns the default value.
@@ -205,6 +215,7 @@ module.exports = {
205215 formatCweLabel : $common . formatCweLabel ,
206216 formatAnalyzerLabel : $common . formatAnalyzerLabel ,
207217 formatTimestamp : $common . formatTimestamp ,
218+ concatenateComponentName : $common . concatenateComponentName ,
208219 valueWithDefault : $common . valueWithDefault ,
209220 calcProgressPercent : $common . calcProgressPercent ,
210221 sleep : $common . sleep ,
0 commit comments