def find.at
import emerging-ezjson@1.3.0.0/src/value.bend as Valueimport Base
305# the matched value, or the next pair when the key differs
306def find.at(rest: Json, +key: String, eq: Bool, vv: Json) -> Json:
307 match rest key eq vv:
308 case r k True{} val:
309 val
310 case JPair{k2, v2, r2} k False{} val:
311 find.at(r2, k, find.eq(k2, k), v2)
312 case JBind{src, n, v2, r2} k False{} val:
313 find.at(r2, k, span.eq(src, n, k), v2)
314 case r k s val:
315 JNull{}