def with.null
ezmcp@0.1.0.0 · src/openapi.bend:437
import ezmcp@0.1.0.0/src/openapi.bend as Openapi
import Base
import emerging-ezjson@1.2.0.0/main.bend as Json
import emerging-ezjson@1.2.0.0/src/value.bend as Value
437
438
439
440def with.null(typ: Value.Json) -> Value.Json:
441 match typ:
442 case Value.JStr{str}:
443 Json.arr([Value.JStr{str}, Json.str("null")])
444 case Value.JSpan{src, +n}:
445 Json.arr([Value.JSpan{src, n}, Json.str("null")])
446 case Value.JArr{+cs}:
447 with.null.arr(any.null(Json.items(Value.JArr{cs})),
448 Json.items(Value.JArr{cs}))
449 case other:
450 other