Setload.truthy: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/setload.bend as Setload Lines 16-32 of cswap-bend-cli@0.1.0.0/setload.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/setload.bend&start_line=16&end_line=32 import Base import cswap-bend-cli@0.1.0.0/json.bend as Json import cswap-bend-cli@0.1.0.0/settings.bend as Settings # Python truthiness of a JSON value. def truthy(j: Json.Json) -> Bool: match j: case Json.JNull{}: False{} case Json.JBool{b}: b case Json.JNum{t}: Bool.not(Settings.is_zero(Settings.lit(t))) case Json.JStr{s}: Bool.not(String.is_empty(s)) case Json.JArr{items}: truthy.items(items) case Json.JObj{fields}: truthy.items(fields) case _: False{} Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.is_empty https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/json.bend&name=Json https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/setload.bend&name=truthy.items https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/settings.bend&name=is_zero https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/settings.bend&name=lit