function loadProjectDependencies(
  projectPath: string,
  dependencies: Array<QueuedDependency>
) {
  return new Promise<Array<Dependency>>((resolve, reject) => {
    asyncMap(
      dependencies,
      function({ name, location }, callback) {
        loadProjectDependency(projectPath, name, location)
          .then(dependency => callback(null, dependency))
          .catch(callback);
      },
      (err, results) => {
        if (err) {
          return reject(err);
        }

        // Filter out any unloaded dependencies
        const filteredResults = results.filter(result => result);

        resolve(filteredResults);
      }
    );
  });
}
Wrapper around `loadProjectDependency` that fetches all dependencies from
an array.