lookupDependencyWithNoEnvOrHasAny function
DependencyConfig?
lookupDependencyWithNoEnvOrHasAny(
- InjectedDependency iDep,
- Set<
DependencyConfig> allDeps, - List<
String> envs
Implementation
DependencyConfig? lookupDependencyWithNoEnvOrHasAny(
InjectedDependency iDep, Set<DependencyConfig> allDeps, List<String> envs) {
try {
return allDeps.firstWhere(
(d) =>
d.type == iDep.type &&
d.instanceName == iDep.instanceName &&
(d.environments.isEmpty ||
envs.isEmpty ||
d.environments.any(
(e) => envs.contains(e),
)),
);
} on StateError {}
return null;
}