sortDependencies function
Implementation
Set<DependencyConfig> sortDependencies(List<DependencyConfig> deps) {
// sort dependencies alphabetically
deps.sort((a, b) => a.type.name.compareTo(b.type.name));
// sort dependencies by their register order
final Set<DependencyConfig> sorted = {};
_sortByDependents(deps.toSet(), sorted);
return sorted;
}