mirror of
https://github.com/TheBinaryNinja/tvapp2.git
synced 2026-06-04 16:25:41 -04:00
chore: remove cjs require in favor of new esm import method
This commit is contained in:
@@ -246,7 +246,7 @@ async function downloadFile(url, filePath) {
|
|||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const isHttps = new URL(url).protocol === 'https:';
|
const isHttps = new URL(url).protocol === 'https:';
|
||||||
const httpModule = isHttps ? require('https') : require('http');
|
const httpModule = isHttps ? https : http;
|
||||||
const file = fs.createWriteStream(filePath);
|
const file = fs.createWriteStream(filePath);
|
||||||
|
|
||||||
httpModule
|
httpModule
|
||||||
@@ -294,7 +294,7 @@ async function ensureFileExists(url, filePath) {
|
|||||||
// TODO: UPDATES TO HANDLER FOR SPORT EVENTS
|
// TODO: UPDATES TO HANDLER FOR SPORT EVENTS
|
||||||
async function fetchSportsData() {
|
async function fetchSportsData() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const isHttps = new URL(externalEvents).protocol === 'https:';
|
const isHttps = new URL(extEvents).protocol === 'https:';
|
||||||
const httpModule = isHttps ? require('https') : require('http');
|
const httpModule = isHttps ? require('https') : require('http');
|
||||||
httpModule
|
httpModule
|
||||||
.get(url, (response) => {
|
.get(url, (response) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user