mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update update-readme.js
This commit is contained in:
parent
da23d7e267
commit
3793895948
3 changed files with 14 additions and 10 deletions
|
@ -1,15 +1,19 @@
|
|||
const _ = require('lodash')
|
||||
|
||||
class API {
|
||||
constructor(filepath) {
|
||||
this.collection = require(filepath)
|
||||
}
|
||||
|
||||
get(id) {
|
||||
return this.collection.find(c => c.id === id)
|
||||
find(query) {
|
||||
return _.find(this.collection, query)
|
||||
}
|
||||
}
|
||||
|
||||
const api = {}
|
||||
|
||||
api.channels = new API('../data/channels.json')
|
||||
api.countries = new API('../data/countries.json')
|
||||
api.subdivisions = new API('../data/subdivisions.json')
|
||||
|
||||
module.exports = api
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue