<commit_before>// @flow
import {createSelector} from 'reselect'
import {namesSelector} from './names'
import toPairs from 'lodash/toPairs'

import type {PlayerMap} from '../../../types'

/**
 * Select names source used for name-input-list component for usage in settings view.
 */
export const nameInputListSourceSelector = createSelector(
  namesSelector,
  (names: PlayerMap<string>) => (
    toPairs(names)
  )
)
<commit_msg>Add type annotation to name-input-list-source selector<commit_after>// @flow
import {createSelector} from 'reselect'
import fromPairs from 'lodash/fromPairs'
import {namesSelector} from './names'
import toPairs from 'lodash/toPairs'

import type {PlayerMap} from '../../../types'

/**
 * PlayerName structure to be passed into name-input-list component.
 * This represent one player in the system.
 * First string is the ID. Second string is the name.
 */
export type PlayerName = [string, string]

export function revert(data: PlayerName[]): PlayerMap<string> {
  return fromPairs(data)
}

/**
 * Select names source used for name-input-list component for usage in settings view.
 */
export const nameInputListSourceSelector = createSelector(
  namesSelector,
  (names: PlayerMap<string>): PlayerName[] => (
    toPairs(names)
  )
)

{'fraction_non_alphanumeric': 0.1196513470681458, 'fraction_numerical': 0.0, 'mean_word_length': 4.351694915254237, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6810551', 'n_tokens_mistral': 372, 'n_tokens_neox': 368, 'n_words': 125}