function | removed v1.9.542 | added v1.9.216 | Edit |
(assert* spec x)
Do not call this directly, use 'assert'.
(defn assert*
[spec x]
(if (valid? spec x)
x
(let [ed (c/merge (assoc (explain-data* spec [] [] [] x)
::failure :assertion-failed))]
(throw (js/Error.
(str "Spec assertion failed\n" (with-out-str (explain-out ed))))))))