funcool / funcool/struct

integer-str passes any numeric

Open
#23 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Clojure
Stars
116
Forks
15
PR merge metrics
No merged PRs in 30d

Description

```clojure
(def integer-str
{:message "must be a long"
:optional true
:validate #(or (number? %) (and (string? %) (str/numeric? %)))
:coerce #(if (number? %) (int %) (str/parse-int %))})
```

`:validate` only checks if it's numeric.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.