fix:#13 colorized array type

This commit is contained in:
Elmar Kresse
2024-06-10 12:00:05 +02:00
parent 439850f69b
commit 387a4664c6

View File

@ -41,7 +41,10 @@ export function parseICalData(
const jCalData = ICAL.parse(icalData);
const comp = new ICAL.Component(jCalData);
const vEvents = comp.getAllSubcomponents("vevent");
const colorDistinctionEvents = extractedColorizedEvents(vEvents);
const events: CalendarComponent[] = vEvents.map((vevent: CalendarComponent) => {
return new ICAL.Event(vevent);
});
const colorDistinctionEvents: ColorDistinctionEvent[] = extractedColorizedEvents(events);
return vEvents.map((vevent: CalendarComponent) => {
const event = new ICAL.Event(vevent);
@ -127,6 +130,7 @@ function colorizeEvents(vEvents: CalendarComponent[]): ColorDistinctionEvent[] {
});
}
// Exported for testing
export const exportedForTesting = {
extractedColorizedEvents,
filterEventsDistinct,