def got.text

bend-kit-oauth2@0.11.0.1 · oauth2.bend:100

import bend-kit-oauth2@0.11.0.1/oauth2.bend as Oauth2
import Base
import bend-kit-json@0.7.0.0/json.bend as Json
import bend-kit-encoding@0.5.0.0/encoding.bend as Enc
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes

100# A string's text, or a number's, as some servers send expires_in as "3600".
101def got.text(v: Json.Val) -> String:
102  match v:
103    case Json.Str{s}:
104      Enc.utf8.decode(s)
105    case Json.Num{s}:
106      Bytes.to_string(s)
107    case other:
108      ""

Uses (4)

Used by (1)