Replace use of string.includes due lack of browser support

This commit is contained in:
gconsidine
2017-09-14 17:27:27 -04:00
parent eab3cb8efd
commit dd62e8ce92
2 changed files with 3 additions and 7 deletions
@@ -14,12 +14,8 @@ export default [function() {
let groups = [];
let quoted;
if (!searchString.includes(' ')) {
return this.splitSearchIntoTerms(this.encode(searchString));
}
searchString.split(' ').forEach(substring => {
if (substring.includes(':"')) {
if (/:"/g.test(substring)) {
if (/"$/.test(substring)) {
groups.push(this.encode(substring));
} else {
@@ -28,7 +24,7 @@ export default [function() {
} else if (quoted) {
quoted += ` ${substring}`;
if (substring.includes('"')) {
if (/"/g.test(substring)) {
groups.push(this.encode(quoted));
quoted = undefined;
}