File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 27242724 (merge (predicate-schemas ) (class-schemas ) (comparator-schemas ) (type-schemas ) (sequence-schemas ) (base-schemas )))
27252725
27262726(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" ))
27292731 registry (if custom (mr/fast-registry {}) (mr/composite-registry (mr/fast-registry (default-schemas )) (mr/var-registry )))]
27302732 (when-not strict (mr/set-default-registry! registry))
27312733 (mr/registry (if strict registry (mr/custom-default-registry )))))
Original file line number Diff line number Diff line change 33 #? (:clj (:import (java.util HashMap Map))))
44
55#?(: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" )))
77
88#?(: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" )))
1010
1111(defprotocol Registry
1212 (-schema [this type] " returns the schema from a registry" )
4040(def ^:private registry* (atom (simple-registry {})))
4141
4242(defn set-default-registry! [?registry]
43- (if-not (identical? mode " strict" )
43+ (if-not #?(:cljs (identical? mode " strict" )
44+ :default (= mode " strict" ))
4445 (reset! registry* (registry ?registry))
4546 (throw (ex-info " can't set default registry, invalid mode" {:mode mode, :type type}))))
4647
You can’t perform that action at this time.
0 commit comments