def redirect.rel.of
import emerging-ezhttp@0.21.0.0/src/redirect.bend as Redirectimport Base
133# a relative-path reference merged with the current path, dot segments
134# removed, then its query
135def redirect.rel.of(base: String, r: Ref) -> String:
136 match r:
137 case Ref{path, query}:
138 redirect.clean(List.tail(&2, String,
139 List.append(&2, String, redirect.init(String.split(base, '/')),
140 String.split(path, '/')))) ++ query