struct icon indicating copy to clipboard operation
struct copied to clipboard

integer-str passes any numeric

Open andrewsuzuki opened this issue 6 years ago • 1 comments

(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.

andrewsuzuki avatar Sep 30 '19 17:09 andrewsuzuki

It seems that cuerdas https://github.com/funcool/cuerdas doesn't have int? for now. Adding int? to cuerdas and using it in struct can be a solution for this.

saitouena avatar Jan 26 '20 03:01 saitouena