mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-13 02:20:03 -04:00
Update utils.js
This commit is contained in:
parent
2aa55af99e
commit
8a2473c64c
1 changed files with 0 additions and 16 deletions
|
@ -74,22 +74,6 @@ utils.removeProtocol = function (string) {
|
|||
return string.replace(/(^\w+:|^)\/\//, '')
|
||||
}
|
||||
|
||||
utils.filterFiles = function (arr, include = '', exclude = '') {
|
||||
if (include) {
|
||||
const included = include.split(',').map(filename => `channels/${filename}.m3u`)
|
||||
|
||||
return arr.filter(filename => included.includes(filename))
|
||||
}
|
||||
|
||||
if (exclude) {
|
||||
const excluded = exclude.split(',').map(filename => `channels/${filename}.m3u`)
|
||||
|
||||
return arr.filter(filename => !excluded.includes(filename))
|
||||
}
|
||||
|
||||
return arr
|
||||
}
|
||||
|
||||
utils.sleep = function (ms) {
|
||||
return function (x) {
|
||||
return new Promise(resolve => setTimeout(() => resolve(x), ms))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue