def unset_in

cswap-bend-cli@0.1.0.0 · setwrite.bend:171

import cswap-bend-cli@0.1.0.0/setwrite.bend as Setwrite
import Base
import cswap-bend-cli@0.1.0.0/setload.bend as Setload
import cswap-bend-cli@0.1.0.0/json.bend as Json
import cswap-bend-cli@0.1.0.0/settings.bend as Settings

171# del raw[section][key]; an emptied section goes too.
172def unset_in(+raw: Json.Json, sp: Settings.Spec) -> Json.Json:
173  match sp:
174    case Settings.Spec{+section, +key, kind, lo, hi, choices, dflt}:
175      unset.fin2(Json.del(key, Setload.section_of(raw, section)), section, Setload.with_version(raw))

Uses (6)

Used by (1)