Skip to content
This repository

dead-simple validations for clojure

branch: master
README.md

corroborate

A dead-simple validations library for Clojure.

Installation:

Leiningen:

[corroborate "0.2.0"]

Maven:

<dependency>
  <groupId>corroborate</groupId>
  <artifactId>corroborate</artifactId>
  <version>0.2.0</version>
</dependency>

Usage

(ns people
  (:use [corroborate.core]))

(defvalidator validate-person
  :first-name (is-required)
  :last-name (is-required)
  :phone (is-formatted #"\(\d{3}\) \d{3}-\d{4}")))

(validate-person {:first-name "Tony" :last-name "" :phone "867-5309"})
; {:last-name ["is required"] :phone ["is improperly formatted"]}

License

Copyright (C) 2011 Tony Pitluga

Distributed under the Eclipse Public License, the same as Clojure.

Something went wrong with that request. Please try again.