def build

bend-toon-codec@0.1.0.0 · src/expand.bend:58

import bend-toon-codec@0.1.0.0/src/expand.bend as Expand
import Base
import bend-toon-codec@0.1.0.0/src/json.bend as J

58# The nested objects for a path ending in `leaf`.
59def build(+segs: List<&2, String>, +leaf: J.Json) -> J.Json:
60  match segs:
61    case Nil{}:
62      leaf
63    case Con{s, rest}:
64      J.JObj{J.JField{s, build(rest, leaf), J.JNil{}}}

Uses (3)

Used by (2)