mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 16:40:07 -04:00
Update configLoader.ts
This commit is contained in:
parent
9ce8d2cd6c
commit
cb52742a1b
1 changed files with 3 additions and 1 deletions
|
@ -1,9 +1,11 @@
|
||||||
import { SiteConfig } from 'epg-grabber'
|
import { SiteConfig } from 'epg-grabber'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
|
import { pathToFileURL } from 'url'
|
||||||
|
|
||||||
export class ConfigLoader {
|
export class ConfigLoader {
|
||||||
async load(filepath: string): Promise<SiteConfig> {
|
async load(filepath: string): Promise<SiteConfig> {
|
||||||
const config = (await import(filepath)).default
|
const fileUrl = pathToFileURL(filepath).toString()
|
||||||
|
const config = (await import(fileUrl)).default
|
||||||
|
|
||||||
return _.merge(
|
return _.merge(
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue