Skip to content

Commit

Permalink
finalize(?) docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ikitommi committed May 8, 2018
1 parent df61d31 commit 2281f29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* `st/type-transformer`, supporting both `:type` and `Spec` level transformations
* Spec-driven transformations via keys in `encode` and `decode` namespaces.
* `st/encode`, `st/decode`, `st/explain`, `st/explain-data`, `st/conform` and `st/conform!` take the transformer instance an optional third argument
* `st/json-transformer` and `st/string-transformer` are shipped out-of-the-box
* `st/json-transformer`, `st/string-transformer`, `strip-extra-keys-transformer` and `fail-on-extra-keys-transformer` are shipped out-of-the-box.

### Transformer

Expand All @@ -31,6 +31,7 @@

```clj
(require '[clojure.spec.alpha :as s])
(require '[spec-tools.core :as st])
(require '[clojure.string :as str])

(s/def ::spec
Expand Down Expand Up @@ -78,15 +79,14 @@ no, as there can be multiple valid representations for a encoded value. But it's
; "KikKa"
; "KIKKA"
; :kikka
; "KIKKA"
```

### Type-driven transformations

* use `:type` information from Specs (mostly resolved automatically)

```clj
(require '[spec-tools.core :as st])

(as-> "2014-02-18T18:25:37Z" $
(st/decode inst? $))
; :clojure.spec.alpha/invalid
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ Functions `encode`, `decode`, `explain`, `explain-data`, `conform` and `conform!
* both take a 2-arity function of `spec value => value` to do the actual transformation

```clj
(require '[clojure.spec.alpha :as s])
(require '[clojure.string :as str])

(s/def ::spec
Expand Down Expand Up @@ -232,8 +231,6 @@ no, as there can be multiple valid representations for a encoded value. But it c
* standard types are: `:long`, `:double`, `:boolean`, `:string`, `:keyword`, `:symbol`, `:uuid`, `:uri`, `:bigdec`, `:date`, `:ratio`, `:map`, `:set` and `:vector`.

```clj
(require '[spec-tools.core :as st])

(as-> "2014-02-18T18:25:37Z" $
(st/decode inst? $))
; :clojure.spec.alpha/invalid
Expand Down

0 comments on commit 2281f29

Please sign in to comment.