(text)
| 543 | |
| 544 | // Case- and accent-insensitive. |
| 545 | const foldText = (text) => |
| 546 | text |
| 547 | .toLowerCase() |
| 548 | .normalize('NFD') |
| 549 | .replace(/[\u0300-\u036f]/g, ''); |
| 550 | |
| 551 | // Every term must match, against name and id combined. |
| 552 | const tvgFilterTerms = foldText(tvgFilter).split(/\s+/).filter(Boolean); |