Skip to content

Commit

Permalink
un-ns opts
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenet committed Jan 25, 2024
1 parent 96f8974 commit b97373d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/exoscale/coax.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
(map (juxt identity identity))
(flatten (concat req opt)))
keys-mapping (merge keys-mapping-unns keys-mapping-ns)]
(fn [x {:as opts :exoscale.coax/keys [closed]}]
(fn [x {:as opts :keys [closed]}]
(if (map? x)
(reduce-kv (fn [m k v]
(let [s-from-mapping (keys-mapping k)
Expand Down Expand Up @@ -138,7 +138,7 @@
;; new-val doesn't match default, keep it
(when-not (= (get x spec) v)
[spec v])))
(coerce spec-form x (assoc opts :exoscale.coax/closed true))))
(coerce spec-form x (assoc opts :closed true))))
x
spec-forms)
:exoscale.coax/invalid)))
Expand Down Expand Up @@ -276,10 +276,10 @@
{:as reg :exoscale.coax/keys [idents]} (-> @registry-ref
(update :exoscale.coax/idents
merge
(:exoscale.coax/idents opts))
(:idents opts))
(update :exoscale.coax/forms
merge
(:exoscale.coax/forms opts))
(:forms opts))
(cond-> enums
(assoc :exoscale.coax/enums enums)))]
(or (cond (qualified-ident? spec-exp)
Expand All @@ -298,7 +298,7 @@
"Get the coercing function from a given key. First it tries to lookup
the coercion on the registry, otherwise try to infer from the
specs. In case nothing is found, identity function is returned."
[spec {:exoscale.coax/keys [idents] :as opts}]
[spec {:keys [idents] :as opts}]
(or (when (qualified-keyword? spec)
(si/registry-lookup (merge (:exoscale.coax/idents @registry-ref)
idents)
Expand Down Expand Up @@ -421,7 +421,7 @@
(defn coerce-structure
"Recursively coerce map values on a structure."
([x] (coerce-structure x {}))
([x {:exoscale.coax/keys [idents op]
([x {:keys [idents op]
:or {op coerce}
:as opts}]
(walk/prewalk (fn [x]
Expand Down

0 comments on commit b97373d

Please # to comment.