Other nutrients

This commit is contained in:
cdricms
2025-09-13 14:21:16 +02:00
parent 4b1a4629fb
commit 31cca10430

View File

@@ -258,6 +258,27 @@ extension Nutriments {
public var sodium: Nutrient? { nutrients["sodium"] }
public var sugars: Nutrient? { nutrients["sugars"] }
public var calcium: Nutrient? { nutrients["calcium"] }
public var otherNutrients: [String: Nutrient] {
var others = nutrients
others.removeValue(forKey: "alcohol")
others.removeValue(forKey: "carbohydrates")
others.removeValue(forKey: "energy")
others.removeValue(forKey: "energy_kj")
others.removeValue(forKey: "energy_kcal")
others.removeValue(forKey: "fat")
others.removeValue(
forKey: "fruits_vegetables_nuts_estimate_from_ingredients")
others.removeValue(forKey: "nova_group")
others.removeValue(forKey: "proteins")
others.removeValue(forKey: "salt")
others.removeValue(forKey: "saturated_fat")
others.removeValue(forKey: "sodium")
others.removeValue(forKey: "sugars")
others.removeValue(forKey: "calcium")
return others
}
}
extension Nutriments: Sequence, IteratorProtocol {