{
  "schemaVersion": 1,
  "slug": "egg-substitution-calculator",
  "category": "cooking",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "664206d907eba13a9f49f759147f9dd535e1444c72cebd60c067e28dd2f3c576",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/egg-substitution-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "m = n × g_type",
    "vars": [
      [
        "n",
        "Number of eggs replaced"
      ],
      [
        "g_type",
        "Grams per egg by substitute type"
      ],
      [
        "m",
        "Total amount needed (g or ml)"
      ]
    ],
    "note": "Table lookup per egg: flax/chia 6 g, commercial powder 9 g, aquafaba 45 ml, banana/applesauce/yogurt 60 g. No closed form—lookup table."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const S = { flax:['1 tbsp flaxseed + 3 tbsp water','6 g flaxseed + 45 ml water',51, 'Binding in cookies and pancakes'], chia:['1 tbsp chia + 3 tbsp water','6 g chia + 45 ml water',51,'Binding in dense bakes'], aquafaba:['3 tbsp aquafaba','45 ml aquafaba',45,'Whipping, meringue and mousse'], banana:['1/2 mashed banana','60 g mashed banana',60,'Sweet, moist cakes and muffins'], applesauce:['1/4 cup applesauce','60 g applesauce',60,'Moisture in low-fat baking'], yogurt:['1/4 cup yogurt','60 g yogurt',60,'Binding and moisture'], commercial:['1.5 tbsp powder + 2 tbsp water','9 g powder + 30 ml water',39,'Follow the product directions; uses vary by product'] }; if(!Number.isFinite(eggs)||eggs<0||eggs>50||!S[substitute])return{__error:'inputError'};const s=S[substitute];const amount={flax:eggs*6+' g flaxseed + '+eggs*45+' ml water',chia:eggs*6+' g chia + '+eggs*45+' ml water',aquafaba:eggs*45+' ml aquafaba',banana:eggs*60+' g mashed banana',applesauce:eggs*60+' g applesauce',yogurt:eggs*60+' g yogurt',commercial:eggs*9+' g powder + '+eggs*30+' ml water'}; return { perEgg: s[0], totalAmount:amount[substitute], totalGrams: eggs*s[2], bestFor: s[3] };",
    "inputs": [
      {
        "name": "eggs",
        "type": "number",
        "default": 2,
        "min": 0,
        "max": 50,
        "step": 1,
        "requiredValue": true
      },
      {
        "name": "substitute",
        "type": "select",
        "default": "flax",
        "options": [
          {
            "value": "flax"
          },
          {
            "value": "chia"
          },
          {
            "value": "aquafaba"
          },
          {
            "value": "banana"
          },
          {
            "value": "applesauce"
          },
          {
            "value": "yogurt"
          },
          {
            "value": "commercial"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "totalAmount",
        "precision": 0,
        "unit": "",
        "type": "text",
        "textNumberPrecision": 2
      },
      {
        "name": "bestFor",
        "precision": 0,
        "unit": "",
        "type": "text"
      },
      {
        "name": "perEgg",
        "precision": 0,
        "unit": "",
        "type": "text"
      },
      {
        "name": "totalGrams",
        "precision": 0,
        "unit": "g",
        "trimTrailingZeros": true
      }
    ],
    "interpret": null
  }
}
