findService<T extends Service> method

T findService <T extends Service>(
  1. Pattern path
)

Retrieves the service assigned to the given path.

Implementation

T findService<T extends Service>(Pattern path) {
  return _serviceLookups.putIfAbsent(path, () {
    return _services[path] ??
        _services[path.toString().replaceAll(_straySlashes, '')];
  }) as T;
}