Skip to content

Commit 4ea9f8a

Browse files
chore: removed extra variable
1 parent 78e7b16 commit 4ea9f8a

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lesson_10/libraries/src/loaders/xavier_cruz_loader.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,16 @@ export class XavierCruzLoader implements Loader {
4747

4848
const lines = fileContents.split('\n');
4949
const newString = lines.slice(1);
50-
const trimmedString = newString;
5150

52-
for (let i = 0; i < trimmedString.length; i++) {
53-
trimmedString[i] = trimmedString[i].substring(
54-
trimmedString[i].indexOf(',') + 1,
55-
);
51+
for (let i = 0; i < newString.length; i++) {
52+
newString[i] = newString[i].substring(newString[i].indexOf(',') + 1);
5653
}
5754

5855
// help from ChatGPT - Fixing the roleStr as Role issue
59-
const credits: Credit[] = trimmedString.map((credit) => {
56+
const credits: Credit[] = newString.map((credit) => {
6057
const [mediaItemId, roleStr, name] = credit.split(',');
6158

59+
// cast roleStr to Role type
6260
const role: Role = roleStr as Role;
6361

6462
return {

0 commit comments

Comments
 (0)