https://github.com/nedap/utils.spec
Utilities for clojure.spec
https://github.com/nedap/utils.spec
Last synced: 10 months ago
JSON representation
Utilities for clojure.spec
- Host: GitHub
- URL: https://github.com/nedap/utils.spec
- Owner: nedap
- License: epl-2.0
- Created: 2019-07-18T14:31:50.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2023-01-11T08:56:30.000Z (over 3 years ago)
- Last Synced: 2025-04-30T21:52:37.905Z (about 1 year ago)
- Language: Clojure
- Homepage:
- Size: 81.1 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: .github/contributing.md
- License: LICENSE
Awesome Lists containing this project
README
# nedap.utils.spec [](https://circleci.com/gh/nedap/utils.spec)
Utilities for [clojure.spec](https://github.com/clojure/spec.alpha).
## Installation
Make sure `[spec-coerce "1.0.0-alpha9"]` (or similar) is present on the classpath and loaded if you want to use `nedap.util.spec.api/coerce-map-indicating-invalidity`.
#### Coordinates
```clojure
[com.nedap.staffing-solutions/utils.spec "1.5.1"]
```
> Note that self-hosted ClojureScript (e.g. Lumo) is unsupported at the moment.
#### Production setup
* In JVM Clojure, set [`*assert*`](https://github.com/technomancy/leiningen/blob/9981ae9086a352caf13a42bff4a7e43faa850452/sample.project.clj#L286) to `false`.
* In ClojureScript, set [`:elide-asserts`](https://clojurescript.org/reference/compiler-options#elide-asserts) to `true`.
## Documentation
Please browse the public namespaces, which are documented, speced and tested.
In case of a failure the `check!` macro will print an explanation and throw an exception. It's recommended not to swallow
these exceptions and rely on exception reporting to discover failures.
It's possible to modify the spec-failure printing by setting `nedap.utils.spec.print-symbol` to any fully qualified symbol.
In cases where a `check!` spec-failure is printed, but the stacktrace is swallowed, one can debug the origin by setting
the java property `nedap.utils.spec.print-stack-frames` to a positive number to print that amount of stackframes before
the exception is raised.
## License
Copyright © Nedap
This program and the accompanying materials are made available under the terms of the [Eclipse Public License 2.0](https://www.eclipse.org/legal/epl-2.0)