We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b12d36d commit 13edde2Copy full SHA for 13edde2
src/chatbot.js
@@ -32,7 +32,13 @@ var chatbot = {
32
},
33
dbFilter: function (db,col,val) {
34
var filtered = db.filter(function(row) {
35
- return row[col].toLowerCase().indexOf(val.toLowerCase()) > -1;
+ var match = true;
36
+ if (!Array.isArray(val)) val = [val];
37
+ val.forEach(v=>{
38
+ if (row[col].toLowerCase().indexOf(v.toLowerCase()) == -1)
39
+ match = false;
40
+ })
41
+ return match;
42
});
43
return filtered;
44
0 commit comments