mirror of
https://github.com/status-im/re-natal.git
synced 2025-01-11 13:14:06 +00:00
Merge pull request #51 from ducky427/master
Set goog.DEBUG and only check schema in development
This commit is contained in:
commit
9a3123f687
@ -11,11 +11,13 @@
|
|||||||
(defn check-and-throw
|
(defn check-and-throw
|
||||||
"throw an exception if db doesn't match the schema."
|
"throw an exception if db doesn't match the schema."
|
||||||
[a-schema db]
|
[a-schema db]
|
||||||
(if-let [problems (s/check a-schema db)]
|
(when-let [problems (s/check a-schema db)]
|
||||||
(throw (js/Error. (str "schema check failed: " problems)))))
|
(throw (js/Error. (str "schema check failed: " problems)))))
|
||||||
|
|
||||||
(def validate-schema-mw
|
(def validate-schema-mw
|
||||||
(after (partial check-and-throw schema)))
|
(if goog.DEBUG
|
||||||
|
(after (partial check-and-throw schema))
|
||||||
|
[]))
|
||||||
|
|
||||||
;; -- Handlers --------------------------------------------------------------
|
;; -- Handlers --------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -11,11 +11,13 @@
|
|||||||
(defn check-and-throw
|
(defn check-and-throw
|
||||||
"throw an exception if db doesn't match the schema."
|
"throw an exception if db doesn't match the schema."
|
||||||
[a-schema db]
|
[a-schema db]
|
||||||
(if-let [problems (s/check a-schema db)]
|
(when-let [problems (s/check a-schema db)]
|
||||||
(throw (js/Error. (str "schema check failed: " problems)))))
|
(throw (js/Error. (str "schema check failed: " problems)))))
|
||||||
|
|
||||||
(def validate-schema-mw
|
(def validate-schema-mw
|
||||||
(after (partial check-and-throw schema)))
|
(if goog.DEBUG
|
||||||
|
(after (partial check-and-throw schema))
|
||||||
|
[]))
|
||||||
|
|
||||||
;; -- Handlers --------------------------------------------------------------
|
;; -- Handlers --------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -35,12 +35,14 @@
|
|||||||
:output-dir "target/ios"
|
:output-dir "target/ios"
|
||||||
:static-fns true
|
:static-fns true
|
||||||
:optimize-constants true
|
:optimize-constants true
|
||||||
:optimizations :simple}}
|
:optimizations :simple
|
||||||
|
:closure-defines {"goog.DEBUG" false}}}
|
||||||
:android {:source-paths ["src" "env/prod"]
|
:android {:source-paths ["src" "env/prod"]
|
||||||
:compiler {:output-to "index.android.js"
|
:compiler {:output-to "index.android.js"
|
||||||
:main "env.android.main"
|
:main "env.android.main"
|
||||||
:output-dir "target/android"
|
:output-dir "target/android"
|
||||||
:static-fns true
|
:static-fns true
|
||||||
:optimize-constants true
|
:optimize-constants true
|
||||||
:optimizations :simple}}}}
|
:optimizations :simple
|
||||||
|
:closure-defines {"goog.DEBUG" false}}}}}
|
||||||
}})
|
}})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user