From 36a334d50074f127d91f004ce5d62316f456eb8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CA1-4U2T1NN=E2=80=9D?= <“a1.austinn19@gmail.com”> Date: Thu, 17 Oct 2024 20:48:53 +0000 Subject: [PATCH] chore: made lesson_10 and lesson_10 extra credit seperate branches; --- lesson_10/libraries/src/loaders/chigazo_graham_loader.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lesson_10/libraries/src/loaders/chigazo_graham_loader.ts b/lesson_10/libraries/src/loaders/chigazo_graham_loader.ts index 984902ef..469de58f 100644 --- a/lesson_10/libraries/src/loaders/chigazo_graham_loader.ts +++ b/lesson_10/libraries/src/loaders/chigazo_graham_loader.ts @@ -21,10 +21,10 @@ export class ChigazoGrahamLoader implements Loader { async loadMediaItems(): Promise { // TODO: Implement this method. - const mediaItems: MediaItem[] = []; - const readable = fs.readFileSync('data/media_items.csv', { - encoding: 'utf-8' - }); + const mediaItems = []; + const readable = fs + .createReadStream('data/credits.csv', 'utf-8') + .pipe(csv()); for await (const row of readable) { const { id, type, title, genre, year } = row; mediaItems.push(new MediaItem( id, type, title, genre, year, ));