function foo(a) { const x = {}; if (a) { let y = {}; x.y = y; } else { let z = {}; x.z = z; } x |> mutate(%); return x; }