Yet another where helper fix
Support nil conditions
This commit is contained in:
parent
96260901c2
commit
febcf385ee
1 changed files with 13 additions and 8 deletions
|
|
@ -10,14 +10,19 @@
|
||||||
|
|
||||||
(defn- and-merge
|
(defn- and-merge
|
||||||
[current args]
|
[current args]
|
||||||
(cond (= :and (first current))
|
(let [args (remove nil? args)]
|
||||||
(default-merge current args)
|
(cond (= :and (first current))
|
||||||
(seq current)
|
(default-merge current args)
|
||||||
(default-merge [:and current] args)
|
(seq current)
|
||||||
(= 1 (count args))
|
(if (seq args)
|
||||||
(vec (first args))
|
(default-merge [:and current] args)
|
||||||
:else
|
current)
|
||||||
(default-merge [:and] args)))
|
(= 1 (count args))
|
||||||
|
(vec (first args))
|
||||||
|
(seq args)
|
||||||
|
(default-merge [:and] args)
|
||||||
|
:else
|
||||||
|
(vec current))))
|
||||||
|
|
||||||
(def ^:private special-merges
|
(def ^:private special-merges
|
||||||
{:where #'and-merge
|
{:where #'and-merge
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue