From fedef396ebdeef00c352a24d44ce48703b4bfc1d Mon Sep 17 00:00:00 2001 From: nathanmarz Date: Wed, 22 Mar 2017 13:30:35 -0400 Subject: [PATCH] change dynamic navs to return single navigator instead of sequence of one nav, helps inline compiler when a nav takes a parameterized navs as input --- src/clj/com/rpl/specter.cljc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/clj/com/rpl/specter.cljc b/src/clj/com/rpl/specter.cljc index 205c802..5a41d9d 100644 --- a/src/clj/com/rpl/specter.cljc +++ b/src/clj/com/rpl/specter.cljc @@ -32,10 +32,15 @@ (defn wrap-dynamic-nav [f] (fn [& args] (let [ret (apply f args)] - (if (and (sequential? ret) (static-path? ret)) - (i/comp-paths* ret) - ret - )))) + (cond (and (sequential? ret) (static-path? ret)) + (i/comp-paths* ret) + + (and (sequential? ret) (= 1 (count ret))) + (first ret) + + :else + ret + )))) #?(:clj (do