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
|
||||
"throw an exception if db doesn't match the schema."
|
||||
[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)))))
|
||||
|
||||
(def validate-schema-mw
|
||||
(after (partial check-and-throw schema)))
|
||||
(if goog.DEBUG
|
||||
(after (partial check-and-throw schema))
|
||||
[]))
|
||||
|
||||
;; -- Handlers --------------------------------------------------------------
|
||||
|
||||
|
@ -11,11 +11,13 @@
|
||||
(defn check-and-throw
|
||||
"throw an exception if db doesn't match the schema."
|
||||
[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)))))
|
||||
|
||||
(def validate-schema-mw
|
||||
(after (partial check-and-throw schema)))
|
||||
(if goog.DEBUG
|
||||
(after (partial check-and-throw schema))
|
||||
[]))
|
||||
|
||||
;; -- Handlers --------------------------------------------------------------
|
||||
|
||||
|
@ -35,12 +35,14 @@
|
||||
:output-dir "target/ios"
|
||||
:static-fns true
|
||||
:optimize-constants true
|
||||
:optimizations :simple}}
|
||||
:optimizations :simple
|
||||
:closure-defines {"goog.DEBUG" false}}}
|
||||
:android {:source-paths ["src" "env/prod"]
|
||||
:compiler {:output-to "index.android.js"
|
||||
:main "env.android.main"
|
||||
:output-dir "target/android"
|
||||
:static-fns true
|
||||
:optimize-constants true
|
||||
:optimizations :simple}}}}
|
||||
:optimizations :simple
|
||||
:closure-defines {"goog.DEBUG" false}}}}}
|
||||
}})
|
||||
|
Loading…
x
Reference in New Issue
Block a user