def canon
import bend-lint-rules@0.2.0.0/layout/canon_import_path.bend as CanonImportPathimport Base
61# The segments as a path that starts with ./ or ../.
62def canon(+parts: List<&2, String>) -> String:
63 match parts:
64 case Con{SCon{'.', SCon{'.', SNil{}}}, rest}:
65 String.join(parts, "/")
66 case _:
67 "./" ++ String.join(parts, "/")