addPackages(addonPackageList, packageInfoList, excludeFn) {
    if (!packageInfoList) {
      return;
    }

    let result = [];
    if (Array.isArray(packageInfoList)) {
      if (excludeFn) {
        packageInfoList = packageInfoList.filter((pkgInfo) => !excludeFn(pkgInfo));
      }

      packageInfoList.forEach((pkgInfo) => result.push(pkgInfo));
    } else {
      // We're going to assume we have a map of name to packageInfo
      Object.keys(packageInfoList).forEach((name) => {
        let pkgInfo = packageInfoList[name];
        if (!excludeFn || !excludeFn(pkgInfo)) {
          result.push(pkgInfo);
        }
      });
    }

    result.sort(lexicographically).forEach((pkgInfo) => pushUnique(addonPackageList, pkgInfo));

    return addonPackageList;
  }
Add to a list of child addon PackageInfos for this packageInfo.

@method addPackages
@param {Array} addonPackageList the list of child addon PackageInfos being constructed from various
sources in this packageInfo.
@param {Array | Object} packageInfoList a list or map of PackageInfos being considered
(e.g., pkgInfo.dependencyPackages) for inclusion in the addonPackageList.
@param {Function} excludeFn an optional function. If passed in, each child PackageInfo
will be tested against the function and only included in the package map if the function
returns a truthy value.