MlbendHuggingface.json_of: def of mlbend-huggingface@0.1.1.0 Import: import mlbend-huggingface@0.1.1.0/main.bend as MlbendHuggingface Lines 82-90 of mlbend-huggingface@0.1.1.0/main.bend: https://jend.leeeet.dev/read.txt?path=mlbend-huggingface@0.1.1.0/main.bend&start_line=82&end_line=90 import Base import bend-kit-http@0.36.0.0/http.bend as Http import bend-kit-json@0.6.1.1/json.bend as Json # The JSON of a response, or the reason there is none. def json_of(r: Result<&1, &1, Http.Err, Http.Res>) -> Result<&1, &1, Err, Json.Val>: match r: case Fail{e}: Fail{why_of(e)} case Done{Http.Res{+status, headers, body}}: Bool.pick(Result<&1, &1, Err, Json.Val>, U32.is_lt(status, 400), json_of_body(body), Fail{ErrStatus{status}}) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=Err https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=Res https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=Val https://jend.leeeet.dev/definition.txt?path=mlbend-huggingface@0.1.1.0/main.bend&name=Err https://jend.leeeet.dev/definition.txt?path=mlbend-huggingface@0.1.1.0/main.bend&name=json_of_body https://jend.leeeet.dev/definition.txt?path=mlbend-huggingface@0.1.1.0/main.bend&name=why_of