Skip to content

Commit fc5a45b

Browse files
author
dnolen
committed
only print specs in REPL if we actually have some
1 parent 3977b13 commit fc5a45b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/main/cljs/cljs/repl.cljs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@
4949
(when doc
5050
(println " " doc))))
5151
(when n
52-
(when-let [specs (spec/fn-specs (symbol (str (ns-name n)) (name nm)))]
53-
(println "Spec")
54-
(run! (fn [[role spec]]
55-
(when (and spec (not (= spec ::spec/unknown)))
56-
(println " " (str (name role) ":") (spec/describe spec))))
57-
specs))))))
52+
(let [specs (spec/fn-specs (symbol (str (ns-name n)) (name nm)))]
53+
(when (some identity (vals specs))
54+
(print "Spec")
55+
(run! (fn [[role spec]]
56+
(when (and spec (not (= spec ::spec/unknown)))
57+
(print (str "\n " (name role) ":") (spec/describe spec))))
58+
specs)))))))

0 commit comments

Comments
 (0)