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