@@ -139,8 +139,8 @@ export const Converter = (config: YourGlobalConfig) => {
139
139
...cpuParam ,
140
140
...memoryParam ,
141
141
} ;
142
- cpuEnergy = cpuEnergy ? cpuEnergy : 0 ;
143
- memoryEnergy = memoryEnergy ? memoryEnergy : 0 ;
142
+ cpuEnergy ??= 0 ;
143
+ memoryEnergy ??= 0 ;
144
144
return useEnergySum ? { energy : cpuEnergy + memoryEnergy } : componentParams ;
145
145
} ;
146
146
@@ -160,7 +160,7 @@ export const Converter = (config: YourGlobalConfig) => {
160
160
...operationalParam ,
161
161
...embodiedParam ,
162
162
} ;
163
- embodiedEmissions = embodiedEmissions ? embodiedEmissions : 0 ;
163
+ embodiedEmissions ??= 0 ;
164
164
165
165
return useCarbonSum
166
166
? { carbon : operatingEmissions + embodiedEmissions }
@@ -215,8 +215,8 @@ export const Converter = (config: YourGlobalConfig) => {
215
215
216
216
return {
217
217
...input ,
218
- ...getEnergyOutputParams ( cpuEnergy , undefined ) ,
219
- ...getEmissionOutputParams ( operatingEmissions , undefined ) ,
218
+ ...getEnergyOutputParams ( cpuEnergy ) ,
219
+ ...getEmissionOutputParams ( operatingEmissions ) ,
220
220
...getCarbonIntensityParam ( operatingEmissions , cpuEnergy ) ,
221
221
} ;
222
222
} ) ;
@@ -237,7 +237,7 @@ export const Converter = (config: YourGlobalConfig) => {
237
237
return {
238
238
...input ,
239
239
...getEnergyOutputParams ( undefined , memoryEnergy ) ,
240
- ...getEmissionOutputParams ( operatingEmissions , undefined ) ,
240
+ ...getEmissionOutputParams ( operatingEmissions ) ,
241
241
...getCarbonIntensityParam ( operatingEmissions , memoryEnergy ) ,
242
242
} ;
243
243
} ) ;
@@ -258,7 +258,7 @@ export const Converter = (config: YourGlobalConfig) => {
258
258
return {
259
259
...input ,
260
260
energy : energy ,
261
- ...getEmissionOutputParams ( operatingEmissions , undefined ) ,
261
+ ...getEmissionOutputParams ( operatingEmissions ) ,
262
262
...getCarbonIntensityParam ( operatingEmissions , energy ) ,
263
263
} ;
264
264
} ) ;
0 commit comments