code: function filterCategory(posts) {
        var reCat = new RegExp(cat);
        return posts.filter(function filterPosts(post) {
          return post.categories.data.some(function checkRe(postCat) {
            return reCat.test(postCat.name);
          });
        });
      }
docs: filter the posts using a category if supplied