'use babel'

export function getEditorsMap(editors) {
  const map = {}
  editors.forEach(function(ui) {
    const path = ui.editor.getPath()
    if (typeof map[path] === 'undefined') {
      map[path] = [ui]
    } else {
      map[path].push(ui)
    }
  })
  return map
}

'use babel'

export function getEditorsMap(editorUI) {
  const editors = {}
  const diff = {}
  const activePaths = new Set()
  editorUI.forEach(function(ui) {
    const path = ui.editor.getPath()
    if (path) {
      if (typeof editors[path] === 'undefined') {
        editors[path] = [ui]
        diff[path] = {added: [], removed: []}
        activePaths.add(path)
      } else {
        editors[path].push(ui)
      }
    }
  })
  return {editors, diff, activePaths}
}

Make map usable in diffs
:art: Make map usable in diffs
