@@ -26,28 +26,28 @@ export class LjMcwilliamsLoader implements Loader {
26
26
. createReadStream ( 'data/media_items.csv' , 'utf-8' )
27
27
. pipe ( csv ( ) ) ;
28
28
for await ( const row of readable ) {
29
- /**this destructures the CSV file rows */
29
+ /**This destructures the CSV file rows. */
30
30
const { id, type, title, year } = row ;
31
31
media . push ( new MediaItem ( id , title , type , year , [ ] ) ) ;
32
32
}
33
33
return media ;
34
34
}
35
35
36
36
/*
37
- an asyncchronous function named loadCredits
38
- returns a Promise of an array of Credit Objects
37
+ An asyncchronous function named loadCredits
38
+ returns a Promise of an array of Credit Objects.
39
39
*/
40
40
async loadCredits ( ) : Promise < Credit [ ] > {
41
41
//the empty credits array will store parsed credit data
42
42
const credits = [ ] ;
43
43
/**
44
- * this var creates a readable stream from the CSV file and
45
- * is piped through the csv function to parse the data
44
+ * This var creates a readable stream from the CSV file and
45
+ * is piped through the csv function to parse the data.
46
46
*/
47
47
const readable = fs
48
48
. createReadStream ( 'data/credits.csv' , 'utf-8' )
49
49
. pipe ( csv ( ) ) ;
50
- //this asynchronously iterates over each row of the parsed CSV data
50
+ //This asynchronously iterates over each row of the parsed CSV data.
51
51
for await ( const row of readable ) {
52
52
const { media_item_id, role, name } = row ;
53
53
credits . push ( new Credit ( media_item_id , name , role ) ) ;
0 commit comments