Ops.plist_scalar: def of near-v-framework@0.4.0.0
Import: import near-v-framework@0.4.0.0/domain/architecture/system/deployment/nix_darwin/setting/ops.bend as Ops
Lines 347-354 of near-v-framework@0.4.0.0/domain/architecture/system/deployment/nix_darwin/setting/ops.bend: https://jend.leeeet.dev/read.txt?path=near-v-framework@0.4.0.0/domain/architecture/system/deployment/nix_darwin/setting/ops.bend&start_line=347&end_line=354
import Base
# "" -> "1", "" -> "0", "3" -> "3", "a & b" -> "a & b";
# "" when unset or not a scalar.
def plist_scalar(+v: String) -> String:
+t = String.trim(v)
Bool.pick(String, String.starts_with(t, ""), "1",
Bool.pick(String, String.starts_with(t, ""), "0",
Bool.pick(String, String.starts_with(t, "'), 1n), ""), '<')), "")))))
Uses (11):
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Char
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.get
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.head
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe.default
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.split
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.starts_with
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.trim
https://jend.leeeet.dev/definition.txt?path=near-v-framework@0.4.0.0/domain/architecture/system/deployment/nix_darwin/setting/ops.bend&name=xml_unescape