From 074fbe67d8e13595f8011ca57c532be2f4df51f1 Mon Sep 17 00:00:00 2001 From: Aetherinox Date: Fri, 21 Mar 2025 02:16:08 -0700 Subject: [PATCH] chore: remove cjs `require` in favor of new esm import method --- tvapp2/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tvapp2/index.js b/tvapp2/index.js index 73539636..2578da2a 100755 --- a/tvapp2/index.js +++ b/tvapp2/index.js @@ -246,7 +246,7 @@ async function downloadFile(url, filePath) { return new Promise((resolve, reject) => { const isHttps = new URL(url).protocol === 'https:'; - const httpModule = isHttps ? require('https') : require('http'); + const httpModule = isHttps ? https : http; const file = fs.createWriteStream(filePath); httpModule @@ -294,7 +294,7 @@ async function ensureFileExists(url, filePath) { // TODO: UPDATES TO HANDLER FOR SPORT EVENTS async function fetchSportsData() { 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'); httpModule .get(url, (response) => {