getDependencies method

dynamic getDependencies(
  1. dynamic type
)

Requests all dependencies of the specified type asynchronously, with caching. @param {string} type @return {Promise<Array

Implementation

getDependencies(type) async {
  var dependencies = cache.get(type);

  if (dependencies != null) {
    return dependencies;
  }

  var parser = this;
  var defs = json[type + (type == 'mesh' ? 'es' : 's')] ?? [];

  List deps = [];

  int l = defs.length;

  for (var i = 0; i < l; i++) {
    var dep = await parser.getDependency(type, i);
    deps.add(dep);
  }

  cache.add(type, deps);

  return deps;
}