<commit_before>import { connect } from 'react-redux';

import Tags from '../../components/Tags';
import handleAction from '../../actions';

function mapStateToProps(state) {
  const {
      entities,
      itemToUpdateID,
      tags,
  } = state;
  const itemToUpdate = entities[itemToUpdateID];

  return {
    bookmarkTagIDs: itemToUpdate ? itemToUpdate.tags : [],
    tags,
  };
}
<commit_msg>Sort tags<commit_after>import { connect } from 'react-redux';

import Tags from '../../components/Tags';
import handleAction from '../../actions';

function sortTags(tags) {
  const sortedTags = [...tags];
  sortedTags.sort((tag1, tag2) => {
    if (tag1.title < tag2.title) {
      return -1;
    } else if (tag1.title > tag2.title) {
      return 1;
    } else {
      return 0;
    }
  });
  return sortedTags;
}

function mapStateToProps(state) {
  const {
      entities,
      itemToUpdateID,
      tags,
  } = state;
  const itemToUpdate = entities[itemToUpdateID];

  return {
    bookmarkTagIDs: itemToUpdate ? itemToUpdate.tags : [],
    tags: sortTags(tags),
  };
}

{'fraction_non_alphanumeric': 0.1435228331780056, 'fraction_numerical': 0.008387698042870456, 'mean_word_length': 2.835714285714286, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, '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': '905416', 'n_tokens_mistral': 351, 'n_tokens_neox': 354, 'n_words': 79}