Skip to content

Commit 8646e6d

Browse files
committed
Fix type error in schema.ics.ts, preventing build
1 parent 712a046 commit 8646e6d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pages/api/schema.ics.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,12 @@ async function createMergedCalendar(
116116
)
117117
)
118118
.then(calendars => {
119-
return mergeCalendars(
120-
calendars.filter(calendar => calendar != undefined)
121-
)
119+
const isCalendar = (
120+
maybeCalendar: Calendar | undefined
121+
): maybeCalendar is Calendar => calendar !== undefined
122+
123+
const filteredCalendars: Calendar[] = calendars.filter(isCalendar)
124+
return mergeCalendars(filteredCalendars)
122125
})
123126
calendar.setProductId(productId)
124127
return calendar

0 commit comments

Comments
 (0)