def scal

cswap-bend-cli@0.1.0.0 · fmt/shape.bend:54

import cswap-bend-cli@0.1.0.0/fmt/shape.bend as Shape
import Base
import cswap-bend-cli@0.1.0.0/json.bend as Json

54# A scalar as its text; a container as compact JSON.
55def scal(+j: Json.Json) -> String:
56  match j:
57    case Json.JNull{}:
58      ""
59    case Json.JBool{b}:
60      Json.bool.show(b)
61    case Json.JNum{t}:
62      t
63    case Json.JStr{s}:
64      s
65    case _:
66      Json.emit(j)

Uses (4)

Used by (2)