File tree 2 files changed +8
-5
lines changed
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 2724
2724
(merge (predicate-schemas ) (class-schemas ) (comparator-schemas ) (type-schemas ) (sequence-schemas ) (base-schemas )))
2725
2725
2726
2726
(def default-registry
2727
- (let [strict (identical? mr/mode " strict" )
2728
- custom (identical? mr/type " custom" )
2727
+ (let [strict #?(:cljs (identical? mr/mode " strict" )
2728
+ :default (= mr/mode " strict" ))
2729
+ custom #?(:cljs (identical? mr/type " custom" )
2730
+ :default (= mr/type " custom" ))
2729
2731
registry (if custom (mr/fast-registry {}) (mr/composite-registry (mr/fast-registry (default-schemas )) (mr/var-registry )))]
2730
2732
(when-not strict (mr/set-default-registry! registry))
2731
2733
(mr/registry (if strict registry (mr/custom-default-registry )))))
Original file line number Diff line number Diff line change 3
3
#? (:clj (:import (java.util HashMap Map))))
4
4
5
5
#?(:cljs (goog-define mode " default" )
6
- :clj (def mode (as-> ( or (System/getProperty " malli.registry/mode" ) " default" ) $ ( .intern $) )))
6
+ :clj (def mode (or (System/getProperty " malli.registry/mode" ) " default" )))
7
7
8
8
#?(:cljs (goog-define type " default" )
9
- :clj (def type (as-> ( or (System/getProperty " malli.registry/type" ) " default" ) $ ( .intern $) )))
9
+ :clj (def type (or (System/getProperty " malli.registry/type" ) " default" )))
10
10
11
11
(defprotocol Registry
12
12
(-schema [this type] " returns the schema from a registry" )
40
40
(def ^:private registry* (atom (simple-registry {})))
41
41
42
42
(defn set-default-registry! [?registry]
43
- (if-not (identical? mode " strict" )
43
+ (if-not #?(:cljs (identical? mode " strict" )
44
+ :default (= mode " strict" ))
44
45
(reset! registry* (registry ?registry))
45
46
(throw (ex-info " can't set default registry, invalid mode" {:mode mode, :type type}))))
46
47
You can’t perform that action at this time.
0 commit comments