def Yaml.value

bend-kube-runtime@0.2.0.0 · src/yaml.bend:700

import bend-kube-runtime@0.2.0.0/src/yaml.bend as Yaml
import Base
import bend-kube-runtime@0.2.0.0/src/json.bend as J

700# A finished container's value.
701def Yaml.value(f: YFrame) -> J.Json:
702  match f:
703    case YMap{i, ms, p}:
704      J.JObj{Yaml.rev_kv(Yaml.pend_null(p, ms), J.JNil{})}
705    case YSeq{i, xs, None{}}:
706      J.JArr{Yaml.rev_items(xs, J.JNil{})}
707    case YSeq{i, xs, Some{a}}:
708      J.JArr{Yaml.rev_items(Yaml.wrap(a, J.JNull{}) <> xs, J.JNil{})}
709    case YRoot{v}:
710      v

Uses (8)

Used by (2)