var features = require("./features.json");

exports.toArray = function (item) {
  return (item instanceof Array) ? item : [item];
};

exports.find = function (query) {
  if(query) {
    return features.filter(function (feature) {
      //return example.code.indexOf(query) > -1;
      return Object.keys(feature.examples).some(function (key) {
        return feature.examples[key].indexOf(query) > -1;
      });
    });
    //return new Array(_.findWhere(exports.getLibraries(), { name: names }));
  } else {
    return features;
  }
};

@@ -37,16 +37,93 @@
 son%22);%0A%0A
+function contains(string, query) %7B%0A  return string.indexOf(query) !== -1;%0A%7D%0A%0A
 exports.
@@ -425,24 +425,33 @@
      return 
+contains(
 feature.exam
@@ -459,36 +459,24 @@
 les%5Bkey%5D
-.indexOf(
+, 
 query)
- %3E -1
 ;%0A      

Extract a new contains() function