Swift URLs can refer to relative paths, absolute paths, might or might not contain / at the end of the path, so in general the type does not have much guarantees when working with. This makes working with them in the website generation quite error-prone and it's hard to reason about the type of URL received as an argument without keeping the whole website generation code base in our head.
We should use some ideas from https://github.com/sersoft-gmbh/path-wrangler, along with new nominal types for different purposes, e.g. absolute path on disk vs absolute path for a web url.
This could save us from many calls from url.standardized that we sometimes use throughout the code base to be sure that we don't have weird things going on in the URL, and we can compare them part-wise to e.g. determine when one url subsumes another one.
Swift URLs can refer to relative paths, absolute paths, might or might not contain
/
at the end of the path, so in general the type does not have much guarantees when working with. This makes working with them in the website generation quite error-prone and it's hard to reason about the type of URL received as an argument without keeping the whole website generation code base in our head.We should use some ideas from https://github.com/sersoft-gmbh/path-wrangler, along with new nominal types for different purposes, e.g. absolute path on disk vs absolute path for a web url.
This could save us from many calls from
url.standardized
that we sometimes use throughout the code base to be sure that we don't have weird things going on in the URL, and we can compare them part-wise to e.g. determine when one url subsumes another one.