def as_u32

cswap-bend-cli@0.1.0.0 · json.bend:328

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

328# A non-negative integer that fits U32; `5.0`, `-1` and `1e3` are None.
329def as_u32(j: Json) -> Maybe<&2, U32>:
330  match j:
331    case JNum{t}:
332      U32.read(t)
333    case _:
334      None{}

Uses (4)

Used by (5)