def Json.set
import bend-kube-runtime@0.2.0.0/src/json.bend as Jsonimport Base
189# Sets key in an object's member chain, replacing the first match or
190# appending at the end.
191def Json.set(j: Json, +key: String, v: Json) -> Json:
192 match j:
193 case JObj{ms}:
194 JObj{Json.put_mem(ms, key, v)}
195 case _:
196 JObj{JMem{key, v, JNil{}}}