assert
macrov1.9
cljs.spec.alpha/assert
(assert [spec x])spec-checking assert expression. Returns x if x is valid? according
to spec, else throws an error with explain-data plus ::failure of
:assertion-failed.
Can be disabled at either compile time or runtime:
If *compile-asserts* is false at compile time, compiles to x. Defaults
to the negation value of the ':elide-asserts' compiler option, or true if
not set.
If (check-asserts?) is false at runtime, always returns x. Defaults to
value of 'cljs.spec.alpha/*runtime-asserts*', or false if not set. You can
toggle check-asserts? with (check-asserts bool).
Examples
No examples yet. Be the first to add one!