You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
816 B
Clojure

(ns org.domaindrivenarchitecture.fed-poc.spec-helper
"A swallow spec translation implementation of owl. Inheritance of FunctionalProperty
is realized in deep implemented."
(:require
[clojure.spec.alpha :as s]
[orchestra.core :refer [defn-spec]]))
(defn-spec map-spec s/spec?
"Spec that applies only for map values."
[spec s/spec?]
(s/and
(s/or
:no-map #(not (map? %))
:map spec)))
(defn-spec seq-spec s/spec?
"Spec that applies only for map values."
[spec s/spec?]
(s/and
(s/or
:single-value spec
:coll-of-values (s/+ spec))))
(defn-spec
is-functional-property? boolean?
"Checks whether spec is a FunctionalProperty."
[spec s/spec?]
(if ( s/get-spec spec)
(some
#(clojure.string/includes? % "FunctionalProperty")
(s/describe spec))
false))