{"size": 557, "ext": "js", "max_stars_repo_path": "lib/program/double-short-options.js", "max_stars_repo_name": "rixo/zoar", "max_stars_repo_stars_event_min_datetime": "2020-03-08T09:41:44.000Z", "max_stars_repo_stars_event_max_datetime": "2020-03-08T09:41:44.000Z", "max_issues_repo_path": "lib/program/double-short-options.js", "max_issues_repo_name": "rixo/zoar", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/program/double-short-options.js", "max_forks_repo_name": "rixo/zoar", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.2083333333, "max_line_length": 52, "alphanum_fraction": 0.5421903052}
const createReducer = doublables => (args, arg) => {
  if (arg.slice(0, 1) === '-') {
    const z = arg.slice(-1)
    const y = arg.slice(-2, -1)
    if (y === z && doublables[y]) {
      const rest = arg.slice(1, -2)
      if (rest.length > 0) {
        args.push(arg.slice(0, -2))
      }
      args.push('--' + doublables[y])
    } else {
      args.push(arg)
    }
  } else {
    args.push(arg)
  }
  return args
}

export const parseDoubleShorts = doublables => {
  const reducer = createReducer(doublables)
  return argv => argv.reduce(reducer, [])
}
