Skip to content

Commit

Permalink
[#38] Refactor zen.schema/compile-schema when-fn check
Browse files Browse the repository at this point in the history
Co-authored-by: @islambegkatibov <[email protected]>
  • Loading branch information
KGOH and katibov committed Jan 20, 2023
1 parent 5a280d3 commit 865d98d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/zen/schema.clj
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@
vtx* (navigate-props (assoc vtx :type (:type schema)) data props opts)]
(if (empty? rs)
vtx*
(let [{when-fn :when rule-fn :rule} (first rs)
when-fn (or when-fn (constantly true))]
(if (when-fn data)
(let [{when-fn :when rule-fn :rule} (first rs)]
(if (or (nil? when-fn) (when-fn data))
(recur (rest rs) (rule-fn vtx* data opts))
(recur (rest rs) vtx*))))))]

Expand Down

0 comments on commit 865d98d

Please sign in to comment.