Skip to content

Commit

Permalink
fix: array must be empty if it contains an undefined element
Browse files Browse the repository at this point in the history
Co-authored-by: Vincent Hyvert <[email protected]>
  • Loading branch information
maelgangloff and vinceh121 committed Nov 3, 2023
1 parent 43ebfc9 commit 21c0395
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/models/Calendar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ END:VEVENT`
}

public toICalendar (dtstamp: Date = new Date(), name = 'Agenda Skolengo'): string {
const lessons = this.map(j => j.lessons).flat()
const lessons = [...this].map(j => j.lessons).flat()
const calendarName = name ?? 'Agenda Skolengo'
return `BEGIN:VCALENDAR
VERSION:2.0
Expand Down
2 changes: 1 addition & 1 deletion src/models/SchoolLife/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class AbsenceFilesResponse extends Array<AbsenceFile> {

public toCSV (): string {
return 'created,type,status,start,end,reason,reason_label\n' +
this.map(file => {
[...this].map(file => {
const {
creationDateTime,
absenceType,
Expand Down

0 comments on commit 21c0395

Please sign in to comment.