def params.put

ezmcp@0.1.0.0 · src/openapi.bend:760

import ezmcp@0.1.0.0/src/openapi.bend as Openapi
import Base
import emerging-ezjson@1.2.0.0/src/value.bend as Value

760# parameters with `new` in the place of the first that is the same
761# parameter (`same`), else last
762def params.put(ps: List<&2, Value.Json>, +new: Value.Json) -> List<&2, Value.Json>:
763  match ps:
764    case []:
765      [new]
766    case +old <> +rest:
767      params.put.at(same(old, new), old, rest, new, _u => params.put(rest, new))

Uses (4)

Used by (1)