Config.truthy: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/daemon/config.bend as Config Lines 97-111 of cswap-bend-cli@0.1.0.0/daemon/config.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/daemon/config.bend&start_line=97&end_line=111 import Base import cswap-bend-cli@0.1.0.0/json.bend as Json # A bool field is read by truthiness: the string "false" is true. def truthy(+m: Maybe<&2, Json.Json>, +d: Bool) -> Bool: match m: case Some{Json.JBool{b}}: b case Some{Json.JNull{}}: False{} case Some{Json.JStr{s}}: Bool.not(String.is_empty(s)) case Some{Json.JNum{t}}: Bool.not(String.eq(t, "0") || String.eq(t, "0.0")) case Some{j}: True{} case None{}: d 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=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.eq 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