lib/edit.js
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);
        });
      });
    }
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);
        });
      });
    }
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 ) ; } ) ; } ) ; }
filter the posts using a category if supplied
filter the posts using a category if supplied