Add ensure-slash function

This commit is contained in:
Unknown 2018-10-28 16:20:45 +09:00
parent ca9de58502
commit e2e96e8f1e

View file

@ -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}]