Skip to content

Commit

Permalink
Refactor: more Array#at() and String#charAt() safety (#760)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmercm authored Oct 13, 2023
1 parent 70297da commit 582423b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/types/outputFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export default class OutputFactory {

// Find the letter for every ROM filename
let lettersToFilenames = (romBasenames ?? [romBasename]).reduce((map, filename) => {
let letter = filename[0].toUpperCase();
let letter = filename.charAt(0).toUpperCase();
if (letter.match(/[^A-Z]/)) {
letter = '#';
}
Expand Down
2 changes: 1 addition & 1 deletion src/types/releaseCandidate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default class ReleaseCandidate {
return this.release.getRegion();
}

return this.game.getRegions()[0];
return this.game.getRegions().at(0);
}

getLanguages(): string[] {
Expand Down

0 comments on commit 582423b

Please sign in to comment.