mirror of
https://github.com/metosin/reitit.git
synced 2025-12-21 18:11:12 +00:00
Add ensure-slash function
This commit is contained in:
parent
ca9de58502
commit
e2e96e8f1e
1 changed files with 6 additions and 0 deletions
|
|
@ -30,6 +30,12 @@
|
||||||
nil
|
nil
|
||||||
(expand [_ _]))
|
(expand [_ _]))
|
||||||
|
|
||||||
|
(defn ensure-slash
|
||||||
|
[^String string]
|
||||||
|
(if (.endsWith string "/")
|
||||||
|
string
|
||||||
|
(str string "/")))
|
||||||
|
|
||||||
(defn walk [raw-routes {:keys [path data routes expand]
|
(defn walk [raw-routes {:keys [path data routes expand]
|
||||||
:or {data [], routes [], expand expand}
|
:or {data [], routes [], expand expand}
|
||||||
:as opts}]
|
:as opts}]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue