Skip to content

integer-str passes any numeric #23

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions