(defn
matches-file?
[{:keys [file]} link]
(when-let
[link-href (.-href link)]
(let
[match
(string/join
"/"
(take-while
identity
(map
(fn*
[p1__18493# p2__18494#]
(if (= p1__18493# p2__18494#) p1__18493# false))
(reverse (string/split file "/"))
(reverse (string/split (truncate-url link-href) "/")))))
match-length
(count match)
file-name-length
(count (last (string/split file "/")))]
(when
(>= match-length file-name-length)
{:link link,
:link-href link-href,
:match-length match-length,
:current-url-length (count (truncate-url link-href))}))))