Skip to content

listora/constraint-validations-url

Repository files navigation

constraint-validations-url

Build Status

Adds support for validating URLs to constraint

Installation

To install via Leiningen add the following dependency to your project.clj:

[listora/constraint-validations-url "0.0.7"]

Usage

(require '[constraint.core :refer [valid?]]
         '[constraint.validations.url :refer [url url-coercions]])

(valid? (url ["http"])  "http://example.com" url-coercions)  ; => true
(valid? (url ["http"])  "https://example.com" url-coercions) ; => false
(valid? (url ["https"]) "https://example.com" url-coercions) ; => true
(valid? (url ["http" "https"]) "example.com" url-coercions)  ; => false

License

Copyright © 2014 Listora

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

Adds support for validating URLs to constraint

Resources

License

Stars

Watchers

Forks

Packages