Profile.to_json: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/profile.bend as Profile Lines 265-270 of cswap-bend-cli@0.1.0.0/profile.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/profile.bend&start_line=265&end_line=270 import Base import cswap-bend-cli@0.1.0.0/json.bend as Json import cswap-bend-cli@0.1.0.0/policy/safe.bend as SF # The profile as a JSON object laid over `base` (the stored object, so keys we # do not know survive). def to_json(+p: Prof, +base: Json.Json) -> Json.Json: match p: case Prof{n, algo, th, ms, cd, iv}: opt_set("interval_s", num_json(iv), opt_set("cooldown_s", num_json(cd), opt_set("models", models_json(ms), opt_set("threshold", num_json(th), Json.set("strategy", Json.JStr{SF.name(algo)}, base))))) Uses (7): 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/json.bend&name=set https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/policy/safe.bend&name=name https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/profile.bend&name=Prof https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/profile.bend&name=models_json https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/profile.bend&name=num_json https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/profile.bend&name=opt_set