lib/poet/utils.js
function getCategories (posts) {
  var categories = posts.reduce(function (categories, post) {
    if (!post.category) return categories;
    return categories.concat(post.category);
  }, []);

  return _.unique(categories).sort();
}
function getCategories (posts) {
  var categories = posts.reduce(function (categories, post) {
    if (!post.category) return categories;
    return categories.concat(post.category);
  }, []);

  return _.unique(categories).sort();
}
function getCategories ( posts ) { var categories = posts . reduce ( function ( categories , post ) { if ( ! post . category ) return categories ; return categories . concat ( post . category ) ; } , [ ] ) ; return _ . unique ( categories ) . sort ( ) ; }
Takes an array `posts` of sorted posts and returns
a sorted array with all categories

@params {Array} posts
@returns {Array}
Takes an array posts of sorted posts and returns a sorted array with all categories