suitableForInjection function

bool suitableForInjection (
  1. RequestContext req,
  2. ResponseContext res,
  3. InjectionRequest injection
)

Checks if an InjectionRequest can be sufficiently executed within the current request/response context.

Implementation

bool suitableForInjection(
    RequestContext req, ResponseContext res, InjectionRequest injection) {
  return injection.parameters.values.any((p) {
    if (p.match == null) return false;
    var value = p.getValue(req);
    return value == p.match;
  });
}