Skip to content

Commit

Permalink
add :visited-by to :key rule, switch condition clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
carbon-hvze committed Sep 30, 2022
1 parent 5a4a825 commit 736e68c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/zen/v2_validation.clj
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@

strict?
(= (:valmode opts) :strict)]
(if (and node-visited? (not strict?))
(if (and (not strict?) node-visited?)
vtx*
(-> (node-vtx&log vtx* [:values] [key])
(v value opts)
Expand Down Expand Up @@ -767,10 +767,12 @@
(fn [vtx data opts]
(reduce (fn [vtx* [k _]]
(let [node-visited?
(get (:visited vtx) (cur-path vtx [k]))
(when-let [pth (get (:visited vtx*) (cur-path vtx* [k]))]
(:keys (get (:visited-by vtx*) pth)))

strict?
(= (:valmode opts) :strict)]
(if (and node-visited? (not strict?))
(if (and (not strict?) node-visited?)
vtx*
(-> (node-vtx&log vtx* [:key] [k])
(v k opts)
Expand Down

0 comments on commit 736e68c

Please sign in to comment.