getKnownType function

String getKnownType(
  1. Iterable keys
)

The dependency type by convention is the first key however there is no require that it is the first so we need to search the map of keys to see if a know type exits.

Implementation

String getKnownType(Iterable keys) {
  if (keys.contains('path')) return 'path';
  if (keys.contains('git')) return 'git';
  if (keys.contains('hosted')) return 'hosted';
  if (keys.contains('sdk')) return 'sdk';

  return "";
}