Skip to content

Commit

Permalink
Merge pull request #6 from Xerpa/bump-clojure-deps
Browse files Browse the repository at this point in the history
Bump clojure dependencies
  • Loading branch information
macluck authored May 30, 2017
2 parents 182ef40 + 3df8a01 commit 83dcad2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
:url "https://github.com/Vincit/venia"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.9.0-alpha16" :scope "provided"]
[org.clojure/clojurescript "1.9.521" :scope "provided"]]
:dependencies [[org.clojure/clojure "1.9.0-alpha17" :scope "provided"]
[org.clojure/clojurescript "1.9.562" :scope "provided"]]
:plugins [[lein-doo "0.1.7"]]
:clean-targets ^{:protect false} ["resources" "target"]
:aliases {"test" ["do" "test" ["doo" "once" "phantom" "test"]]}
Expand Down
7 changes: 2 additions & 5 deletions src/venia/spec.cljc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(ns venia.spec
(:require #?(:clj [clojure.spec.alpha :as s]
:cljs [cljs.spec :as s])
:cljs [cljs.spec.alpha :as s])
[venia.exception :as ex]))

(s/def :venia/query-name keyword?)
Expand All @@ -24,13 +24,10 @@
(s/def :venia/query-def (s/coll-of (s/or :venia/query-vector (s/coll-of :venia/query)
:venia/query-map (s/coll-of :venia/advanced-query))
:min-count 1))
(defn- invalid? [data]
(= #?(:clj :clojure.spec.alpha/invalid
:cljs :cljs.spec/invalid) data))

(defn query->spec [query]
(let [conformed (s/conform :venia/query-def query)]
(if (invalid? conformed)
(if (= ::s/invalid conformed)
(ex/throw-ex {:venia/ex-type :venia/spec-validation
:venia/ex-explain (s/explain :venia/query-def query)})
conformed)))

0 comments on commit 83dcad2

Please sign in to comment.