def body.obj

cswap-bend-cli@0.1.0.0 · usage/req.bend:110

import cswap-bend-cli@0.1.0.0/usage/req.bend as Req
import Base
import cswap-bend-cli@0.1.0.0/json.bend as Json

110# data.get on a non-object raises AttributeError in the reference.
111def body.obj(j: Json.Json) -> Result<&2, &2, Err, Json.Json>:
112  match j:
113    case Json.JObj{f}:
114      Done{j}
115    case _:
116      Fail{bad("AttributeError")}

Uses (4)

Used by (1)