mirror of
https://github.com/metosin/reitit.git
synced 2025-12-18 08:51:12 +00:00
Add :type meta to Routers
This commit is contained in:
parent
8d99163aef
commit
607e34c671
1 changed files with 5 additions and 0 deletions
|
|
@ -154,6 +154,7 @@
|
||||||
(if name (assoc nl name f) nl)]))
|
(if name (assoc nl name f) nl)]))
|
||||||
[[] {}] compiled)
|
[[] {}] compiled)
|
||||||
lookup (impl/fast-map nl)]
|
lookup (impl/fast-map nl)]
|
||||||
|
^{:type ::router}
|
||||||
(reify
|
(reify
|
||||||
Router
|
Router
|
||||||
(router-name [_]
|
(router-name [_]
|
||||||
|
|
@ -199,6 +200,7 @@
|
||||||
nl)]) [{} {}] compiled)
|
nl)]) [{} {}] compiled)
|
||||||
data (impl/fast-map pl)
|
data (impl/fast-map pl)
|
||||||
lookup (impl/fast-map nl)]
|
lookup (impl/fast-map nl)]
|
||||||
|
^{:type ::router}
|
||||||
(reify Router
|
(reify Router
|
||||||
(router-name [_]
|
(router-name [_]
|
||||||
:lookup-router)
|
:lookup-router)
|
||||||
|
|
@ -235,6 +237,7 @@
|
||||||
(if name (assoc nl name f) nl)]))
|
(if name (assoc nl name f) nl)]))
|
||||||
[nil {}] compiled)
|
[nil {}] compiled)
|
||||||
lookup (impl/fast-map nl)]
|
lookup (impl/fast-map nl)]
|
||||||
|
^{:type ::router}
|
||||||
(reify
|
(reify
|
||||||
Router
|
Router
|
||||||
(router-name [_]
|
(router-name [_]
|
||||||
|
|
@ -272,6 +275,7 @@
|
||||||
[[p data result] :as compiled] (compile-routes routes opts)
|
[[p data result] :as compiled] (compile-routes routes opts)
|
||||||
p #?(:clj (.intern ^String p) :cljs p)
|
p #?(:clj (.intern ^String p) :cljs p)
|
||||||
match (->Match p data result {} p)]
|
match (->Match p data result {} p)]
|
||||||
|
^{:type ::router}
|
||||||
(reify Router
|
(reify Router
|
||||||
(router-name [_]
|
(router-name [_]
|
||||||
:single-static-path-router)
|
:single-static-path-router)
|
||||||
|
|
@ -305,6 +309,7 @@
|
||||||
wildcard-router (prefix-tree-router wild opts)
|
wildcard-router (prefix-tree-router wild opts)
|
||||||
static-router (->static-router lookup opts)
|
static-router (->static-router lookup opts)
|
||||||
names (find-names routes opts)]
|
names (find-names routes opts)]
|
||||||
|
^{:type ::router}
|
||||||
(reify Router
|
(reify Router
|
||||||
(router-name [_]
|
(router-name [_]
|
||||||
:mixed-router)
|
:mixed-router)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue