Update configLoader.ts

This commit is contained in:
freearhey 2023-10-14 18:18:56 +03:00
parent 9ce8d2cd6c
commit cb52742a1b
1 changed files with 3 additions and 1 deletions

View File

@ -1,9 +1,11 @@
import { SiteConfig } from 'epg-grabber'
import _ from 'lodash'
import { pathToFileURL } from 'url'
export class ConfigLoader {
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(
{