lib/collect-file-info.js
async function directoryContents (rootDir, filter, transform) {
  const items = await readdirAsync(rootDir)
  debug(`Directory contents [${items}]`)
  const statedItems = await Promise.all(
    items.map(async item => {
      const itemPath = path.join(rootDir, item)
      const stats = await lstatAsync(itemPath)
      return filter(stats) ? transform(itemPath, stats) : null
    })
  )
  const dirs = statedItems.filter(d => !!d)
  return dirs
}
async function directoryContents (rootDir, filter, transform) {
  const items = await readdirAsync(rootDir)
  debug(`Directory contents [${items}]`)
  const statedItems = await Promise.all(
    items.map(async item => {
      const itemPath = path.join(rootDir, item)
      const stats = await lstatAsync(itemPath)
      return filter(stats) ? transform(itemPath, stats) : null
    })
  )
  const dirs = statedItems.filter(d => !!d)
  return dirs
}
filesUnder