fetchTarget function
Fetches target based on URL
Implementation
UrlTarget? fetchTarget(List<UrlTarget> targets, Uri url) {
for (final t in targets) {
for (final urlPart in t.where) {
if (urlPart == "/") {
return t;
} else if (url.path.contains(urlPart)) {
return t;
}
}
}
return null;
}