code: function createListOfDirectories(prev, dir) {
    return {
      ...prev,
      [dir.split(path.sep).pop()]: dir,
    }
  }
docs: Reduce callback to reduce the list of directories
  @param {object} prev
  @param {array} dir