mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 09:00:07 -04:00
commit
ce2d8366f7
3 changed files with 15 additions and 2 deletions
11
package-lock.json
generated
11
package-lock.json
generated
|
@ -22,6 +22,7 @@
|
|||
"parse-duration": "^1.0.0",
|
||||
"srcset": "^4.0.0",
|
||||
"tabletojson": "^2.0.7",
|
||||
"wildcard-match": "^5.1.2",
|
||||
"xml-js": "^1.6.11"
|
||||
}
|
||||
},
|
||||
|
@ -1605,6 +1606,11 @@
|
|||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/wildcard-match": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/wildcard-match/-/wildcard-match-5.1.2.tgz",
|
||||
"integrity": "sha512-qNXwI591Z88c8bWxp+yjV60Ch4F8Riawe3iGxbzquhy8Xs9m+0+SLFBGb/0yCTIDElawtaImC37fYZ+dr32KqQ=="
|
||||
},
|
||||
"node_modules/word-wrap": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
|
||||
|
@ -2874,6 +2880,11 @@
|
|||
"webidl-conversions": "^6.1.0"
|
||||
}
|
||||
},
|
||||
"wildcard-match": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/wildcard-match/-/wildcard-match-5.1.2.tgz",
|
||||
"integrity": "sha512-qNXwI591Z88c8bWxp+yjV60Ch4F8Riawe3iGxbzquhy8Xs9m+0+SLFBGb/0yCTIDElawtaImC37fYZ+dr32KqQ=="
|
||||
},
|
||||
"word-wrap": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
"parse-duration": "^1.0.0",
|
||||
"srcset": "^4.0.0",
|
||||
"tabletojson": "^2.0.7",
|
||||
"wildcard-match": "^5.1.2",
|
||||
"xml-js": "^1.6.11"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
const glob = require('glob')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const wcmatch = require('wildcard-match')
|
||||
|
||||
function list(pattern, include = [], exclude = []) {
|
||||
return new Promise(resolve => {
|
||||
glob(pattern, function (err, files) {
|
||||
if (include.length) {
|
||||
files = files.filter(filename => include.includes(filename))
|
||||
files = files.filter(filename => include.some(item => wcmatch(item)(filename)))
|
||||
}
|
||||
|
||||
if (exclude.length) {
|
||||
files = files.filter(filename => !exclude.includes(filename))
|
||||
files = files.filter(filename => !exclude.some(item => wcmatch(item)(filename)))
|
||||
}
|
||||
|
||||
resolve(files)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue