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
|
||||
[current args]
|
||||
(let [args (remove nil? args)]
|
||||
(cond (= :and (first current))
|
||||
(default-merge current args)
|
||||
(seq current)
|
||||
(if (seq args)
|
||||
(default-merge [:and current] args)
|
||||
current)
|
||||
(= 1 (count args))
|
||||
(vec (first args))
|
||||
(seq args)
|
||||
(default-merge [:and] args)
|
||||
:else
|
||||
(default-merge [:and] args)))
|
||||
(vec current))))
|
||||
|
||||
(def ^:private special-merges
|
||||
{:where #'and-merge
|
||||
|
|
|
|||
Loading…
Reference in a new issue