async function appendProjectDependencyPaths(
  rootPaths,
  matchPattern,
  modes = ['npm', 'bower'],
) {
  const matcher = getMatcher(matchPattern);

  /** @type {string[]} */
  const depProjectPaths = [];
  for (const targetPath of rootPaths) {
    for (const mode of modes) {
      depProjectPaths.push(...(await readPackageTree(targetPath, matcher, mode)));
    }
  }

  return depProjectPaths.concat(rootPaths).map(toPosixPath);
}
Returns all sub projects matching condition supplied in matchFn
@param {string[]} rootPaths all search-target project paths
@param {string} [matchPattern] base for RegExp
@param {('npm'|'bower')[]} [modes]