mirror of
https://github.com/iptv-org/iptv-org.github.io.git
synced 2025-05-12 01:50:05 -04:00
Added support of regular expressions in the query
This commit is contained in:
parent
aff9c53d41
commit
413674b8de
1 changed files with 3 additions and 1 deletions
|
@ -31,7 +31,9 @@ export function search(_query) {
|
|||
|
||||
const filtered = get(channels).filter(c => {
|
||||
for (let f of filters) {
|
||||
if (!c._searchable[f.field] || c._searchable[f.field].indexOf(f.value) === -1) {
|
||||
if (!f.value) return false
|
||||
const regex = new RegExp(f.value, 'i')
|
||||
if (!c._searchable[f.field] || !regex.test(c._searchable[f.field])) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue