def typed

cswap-bend-cli@0.1.0.0 · setimp.bend:85

import cswap-bend-cli@0.1.0.0/setimp.bend as Setimp
import Base
import cswap-bend-cli@0.1.0.0/json.bend as Json
import cswap-bend-cli@0.1.0.0/fmt/ylex.bend as L

85# A CSV cell as a value: `{}` and `[]` are the empty collections; everything
86# else reads as a YAML plain word (null, true/false, a number, a string).
87def typed(+v: String) -> Json.Json:
88  Bool.pick(Json.Json, String.eq(v, "{}"), Json.JObj{Json.JNil{}},
89  Bool.pick(Json.Json, String.eq(v, "[]"), Json.JArr{Json.JNil{}}, L.resolve(v)))

Uses (5)

Used by (1)