code: function createNav(sources) {
    const defaultCategory = 'Uncategorized';
  
    const sourcesByCategories = sources.
      // get category names
      reduce((categories, source) => categories.
        concat(source.attrs.category || defaultCategory), []).
  
      // remove duplicates
      filter((value, i, self) => self.indexOf(value) === i).
  
      // create category object and fill it with related sources
      reduce((categories, categoryName) => {
        categories.push({
          name: categoryName,
          items: createCategoryItemsFromSources(sources, categoryName)
        });
        return categories;
      }, []);
  
    sourcesByCategories.sort(categoriesSorter);
    sourcesByCategories.
      forEach(category => category.items.sort(categoryItemsSorter));
  
    return sourcesByCategories;
  }
docs: Creates navigation object.
  @param {Array<Source>} sources
  @returns {Array<Object>}