forked from MapComplete/MapComplete
		
	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
 | 
					                return
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            output[key] = output[key].map((v) => applyF(v))
 | 
					            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) {
 | 
					        function asBoolean(key: string, invert: boolean = false) {
 | 
				
			||||||
| 
						 | 
					@ -379,6 +382,7 @@ export default class LinkedDataLoader {
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            return "€" + Number(p)
 | 
					            return "€" + Number(p)
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (output["charge"] && output["timeUnit"]) {
 | 
					        if (output["charge"] && output["timeUnit"]) {
 | 
				
			||||||
            const duration =
 | 
					            const duration =
 | 
				
			||||||
                Number(output["chargeEnd"] ?? "1") - Number(output["chargeStart"] ?? "0")
 | 
					                Number(output["chargeEnd"] ?? "1") - Number(output["chargeStart"] ?? "0")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue