function glutenDetector(ingredients){ const gluten = [ "wheat", "wheat flour", "triticale", "barley", "rye", "brewer's yeast", "malt", "wheatberries", "durum", "emmer", "semolina", "spelt", "farina", "farro", "graham", "kamut", "einkorn" ]; return ingredients .toLowerCase() .split(/[,\s]+/) .some(x => gluten.includes(x)); }
- function glutenDetector(ingredients){
- const gluten = [
- "wheat",
- "wheat flour",
- "triticale",
- "barley",
- "rye",
- "brewer's yeast",
- "malt",
- "wheatberries",
- "durum",
- "emmer",
- "semolina",
- "spelt",
- "farina",
- "farro",
- "graham",
- "kamut",
- "einkorn"
- ];
return !!ingredients- return ingredients
- .toLowerCase()
.split(" ").find(i => gluten.indexOf(i) > -1);- .split(/[,\s]+/)
- .some(x => gluten.includes(x));
- }