def size.obj
import bend-kit-cbor@0.3.0.0/cbor.bend as Cborimport Base
263def size.obj(k: Val, v: Val, r: Val & Nat) -> Val & Nat:
264 (t, n) = r
265 match t:
266 case Obj{items}:
267 (Obj{Con{(k, v), items}}, n)
268 case _:
269 (Obj{Nil{}}, n)