function uniqueDirs(files) {
  const dirs = new Set();
  files.forEach((filepath) => {
    const parts = path.dirname(filepath).split(path.sep);
    let partial = parts[0] || '/';
    dirs.add(partial);
    for (let i = 1, ii = parts.length; i < ii; ++i) {
      partial = path.join(partial, parts[i]);
      dirs.add(partial);
    }
  });
  return Array.from(dirs);
}
Generate a list of unique directory paths given a list of file paths.
@param {Array<string>} files List of file paths.
@return {Array<string>} List of directory paths.