<commit_before>'use strict';

const path = require('path');

const buildNavigation = function(styleguideArray) {
  let options = this;

  options.navigation = {};

  styleguideArray.forEach((obj) => {
    let fileName = (obj.writeName || obj.title).replace(/ /g, '_').toLowerCase() + '.html';

    options.navigation[obj.title] = fileName;
  });

  return styleguideArray;
};

module.exports = buildNavigation;
<commit_msg>Update navigation to be in alphabetical order<commit_after>'use strict';

const buildNavigation = function(styleguideArray) {
  let options = this,
    _nav = {};

  options.navigation = {};

  styleguideArray.forEach((obj) => {
    let fileName = (obj.writeName || obj.title).replace(/ /g, '_').toLowerCase() + '.html';

    _nav[obj.title] = fileName;
  });

  Object.keys(_nav)
    .sort()
    .forEach(function(v, i) {
      options.navigation[v] = _nav[v];
    });

  return styleguideArray;
};

module.exports = buildNavigation;

{'fraction_non_alphanumeric': 0.1617954070981211, 'fraction_numerical': 0.0, 'mean_word_length': 3.8434343434343434, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3370639', 'n_tokens_mistral': 306, 'n_tokens_neox': 309, 'n_words': 62}