pubspecYamlGetDependenciesPackageName function

Iterable<String> pubspecYamlGetDependenciesPackageName(
  1. Map yaml, {
  2. PubDependencyKind? kind,
})

Get the dependencies packages name.

Implementation

Iterable<String> pubspecYamlGetDependenciesPackageName(Map yaml,
    {PubDependencyKind? kind}) {
  kind ??= PubDependencyKind.direct;
  var key = _kindKeyMap[kind]!;
  var dependencies = yaml[key];
  if (dependencies is Map) {
    return dependencies.keys.cast<String>();
  }
  return <String>[];
}