Velopark: drop data if undefined
This commit is contained in:
parent
dd46bfdf3b
commit
d4367e017a
1 changed files with 4 additions and 0 deletions
|
@ -331,6 +331,9 @@ export default class LinkedDataLoader {
|
|||
return
|
||||
}
|
||||
output[key] = output[key].map((v) => applyF(v))
|
||||
if(!output[key].some(v => v !== undefined)){
|
||||
delete output[key]
|
||||
}
|
||||
}
|
||||
|
||||
function asBoolean(key: string, invert: boolean = false) {
|
||||
|
@ -379,6 +382,7 @@ export default class LinkedDataLoader {
|
|||
}
|
||||
return "€" + Number(p)
|
||||
})
|
||||
|
||||
if (output["charge"] && output["timeUnit"]) {
|
||||
const duration =
|
||||
Number(output["chargeEnd"] ?? "1") - Number(output["chargeStart"] ?? "0")
|
||||
|
|
Loading…
Reference in a new issue