Skip to content

Commit

Permalink
[#21] Fix edge-case preventing blank :missing vals (@kaosko)
Browse files Browse the repository at this point in the history
Wasn't an intentional restriction; invariant here can be relaxed.
  • Loading branch information
ptaoussanis committed Apr 15, 2018
1 parent b27d459 commit 9b1c253
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/taoensso/tempura/impl.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
Optimized for fn runtime, not fn creation."
([s] (str->vargs-fn s nil))
([s argval-fn]
(have? enc/nblank? s)
(have? string? s)
(let [parts (str->split-args s)
;; Why the undefined check? Vestigial?
argval-fn (or argval-fn #?(:clj identity :cljs enc/undefined->nil))]
Expand All @@ -73,6 +73,7 @@

(comment
(str->split-args "hello %1 %2")
((str->vargs-fn "") ["a" "b"]) ; ""
((str->vargs-fn "hello %1 %2") ["a" "b"]) ; "hello a b"
((str->vargs-fn "hello") ["a" "b"]) ; "hello"
((str->vargs-fn "%1") ["a" "b"]) ; "a"
Expand Down

0 comments on commit 9b1c253

Please sign in to comment.