<commit_before>import I from 'immutable';

const column = I.Record({
  name: null,
}, 'column');

const columnGroup = I.Record({
  name: null,
  columns: I.List(),
}, 'columnGroup');

const row = I.Record({
  values: I.List(),
}, 'row');

const table = I.Record({
  columnGroups: I.List(),
  rows: I.List(),
  selectedRow: null,
}, 'table');

export const fromJSON = (data) => {
  return data ? table({
    columnGroups: I.List(data.columnGroups).map(
      (group) => columnGroup({
        name: group.name.toString(),
        columns: I.List(group.columns).map(column),
      })
    ),
    rows: I.List(data.rows).map(row),
    selectedRow: data.selectedRow,
  }) : null;
};<commit_msg>selectedRow should be null by default<commit_after>import I from 'immutable';

const column = I.Record({
  name: null,
}, 'column');

const columnGroup = I.Record({
  name: null,
  columns: I.List(),
}, 'columnGroup');

const row = I.Record({
  values: I.List(),
}, 'row');

const table = I.Record({
  columnGroups: I.List(),
  rows: I.List(),
  selectedRow: null,
}, 'table');

export const fromJSON = (data) => {
  const selectedRow =
    (data && data.selectedRow !== void 0) ?
    data.selectedRow : null;

  return data ? table({
    columnGroups: I.List(data.columnGroups).map(
      (group) => columnGroup({
        name: group.name.toString(),
        columns: I.List(group.columns).map(column),
      })
    ),
    rows: I.List(data.rows).map(row),
    selectedRow,
  }) : null;
};
{'fraction_non_alphanumeric': 0.18470906630581868, 'fraction_numerical': 0.0006765899864682003, 'mean_word_length': 3.2745664739884393, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6793996', 'n_tokens_mistral': 503, 'n_tokens_neox': 502, 'n_words': 120}