Skip to content

Commit 21c0395

Browse files
fix: array must be empty if it contains an undefined element
Co-authored-by: Vincent Hyvert <[email protected]>
1 parent 43ebfc9 commit 21c0395

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/models/Calendar/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ END:VEVENT`
3535
}
3636

3737
public toICalendar (dtstamp: Date = new Date(), name = 'Agenda Skolengo'): string {
38-
const lessons = this.map(j => j.lessons).flat()
38+
const lessons = [...this].map(j => j.lessons).flat()
3939
const calendarName = name ?? 'Agenda Skolengo'
4040
return `BEGIN:VCALENDAR
4141
VERSION:2.0

src/models/SchoolLife/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class AbsenceFilesResponse extends Array<AbsenceFile> {
1111

1212
public toCSV (): string {
1313
return 'created,type,status,start,end,reason,reason_label\n' +
14-
this.map(file => {
14+
[...this].map(file => {
1515
const {
1616
creationDateTime,
1717
absenceType,

0 commit comments

Comments
 (0)