findService<T extends Service> method
Retrieves the service assigned to the given path.
Implementation
T? findService<T extends Service>(Pattern path) {
var found =
_serviceLookups[path] ??
_services[path] ??
_services[path.toString().replaceAll(_straySlashes, '')];
// Misses are not cached, so a service mounted later is still found.
if (found != null) _serviceLookups[path] = found;
return found as T?;
}