File tree Expand file tree Collapse file tree
src/cljs/vd_designer/pages/form
test/cljs/vd_designer/pages/form Expand file tree Collapse file tree Original file line number Diff line number Diff line change 365365 select)))))
366366
367367(defn strip-empty-where-nodes [vd]
368- (let [blank? #(and (%1 %2 ) (str/blank? (%1 %2 )))]
369- (update
370- vd
371- :where
372- (fn [where]
373- (remove #(blank? :path %) where)))))
368+ (let [blank? #(and (%1 %2 ) (str/blank? (%1 %2 )))
369+ vd (update vd :where (fn [where] (remove #(blank? :path %) where)))]
370+ (if (seq (:where vd))
371+ vd
372+ (dissoc vd :where ))))
374373
375374(defn strip-empty-collections [vd]
376375 (medley/remove-kv
Original file line number Diff line number Diff line change 336336(deftest strip-empty-where-nodes-test
337337 (testing " strip empty where"
338338 (is (match?
339- {:where [] }
339+ {:where nil }
340340 (sut/strip-empty-where-nodes {:where []}))))
341341 (testing " strip non empty where with empty node"
342342 (is (match?
343- {:where [] }
343+ {:where nil }
344344 (sut/strip-empty-where-nodes {:where [{:path " " }]}))))
345345 (testing " strip non empty where with non empty node"
346346 (is (match?
You can’t perform that action at this time.
0 commit comments