Expand.cell: def of bend-toon-codec@0.1.0.0 Import: import bend-toon-codec@0.1.0.0/src/expand.bend as Expand Lines 95-106 of bend-toon-codec@0.1.0.0/src/expand.bend: https://jend.leeeet.dev/read.txt?path=bend-toon-codec@0.1.0.0/src/expand.bend&start_line=95&end_line=106 import Base import bend-toon-codec@0.1.0.0/src/json.bend as J # A cell of a field chain: replace the value when the key is the path's head, # else look further along the chain. def cell(+hit: Bool, +k: String, +ev: J.Json, +t: J.Json, +rv: Result<&2, &2, String, J.Json>, +rt: Result<&2, &2, String, J.Json>) -> Result<&2, &2, String, J.Json>: match hit rv rt: case True{} Done{v} _: Done{J.JField{k, v, t}} case True{} Fail{e} _: Fail{e} case False{} _ Done{t2}: Done{J.JField{k, ev, t2}} case False{} _ Fail{e}: Fail{e} Uses (4): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=bend-toon-codec@0.1.0.0/src/json.bend&name=Json