fix: use PascalCase for FeedItemType members (#51)

Rename camelCase members to PascalCase in WeatherFeedItemType
and CalendarFeedItemType to match TflFeedItemType and
CalDavFeedItemType conventions.

Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
2026-03-01 22:10:34 +00:00
committed by GitHub
parent 4c9ac2c61a
commit 8ca8a0d1d2
9 changed files with 47 additions and 47 deletions

View File

@@ -3,19 +3,19 @@ import type { FeedItem } from "@aris/core"
import type { CalendarEventData } from "./types"
export const CalendarFeedItemType = {
event: "calendar-event",
allDay: "calendar-all-day",
Event: "calendar-event",
AllDay: "calendar-all-day",
} as const
export type CalendarFeedItemType = (typeof CalendarFeedItemType)[keyof typeof CalendarFeedItemType]
export interface CalendarEventFeedItem extends FeedItem<
typeof CalendarFeedItemType.event,
typeof CalendarFeedItemType.Event,
CalendarEventData
> {}
export interface CalendarAllDayFeedItem extends FeedItem<
typeof CalendarFeedItemType.allDay,
typeof CalendarFeedItemType.AllDay,
CalendarEventData
> {}

View File

@@ -69,7 +69,7 @@ describe("GoogleCalendarSource", () => {
const source = new GoogleCalendarSource({ client: defaultMockClient() })
const items = await source.fetchItems(createContext())
const timedItems = items.filter((i) => i.type === CalendarFeedItemType.event)
const timedItems = items.filter((i) => i.type === CalendarFeedItemType.Event)
expect(timedItems.length).toBe(4)
})
@@ -77,7 +77,7 @@ describe("GoogleCalendarSource", () => {
const source = new GoogleCalendarSource({ client: defaultMockClient() })
const items = await source.fetchItems(createContext())
const allDayItems = items.filter((i) => i.type === CalendarFeedItemType.allDay)
const allDayItems = items.filter((i) => i.type === CalendarFeedItemType.AllDay)
expect(allDayItems.length).toBe(1)
})

View File

@@ -209,7 +209,7 @@ function createFeedItem(
nowMs: number,
lookaheadMs: number,
): CalendarFeedItem {
const itemType = event.isAllDay ? CalendarFeedItemType.allDay : CalendarFeedItemType.event
const itemType = event.isAllDay ? CalendarFeedItemType.AllDay : CalendarFeedItemType.Event
return {
id: `calendar-${event.calendarId}-${event.eventId}`,