The Node.js® Website
1import type { CalendarEvent, ZonedCalendarTime } from '@/types';
2
3export const isZoned = (d: object): d is ZonedCalendarTime =>
4 'dateTime' in d && 'timeZone' in d;
5
6export const getZoomLink = (
7 event: Pick<CalendarEvent, 'description' | 'location'>
8) =>
9 event.description?.match(/https:\/\/zoom.us\/j\/\d+/)?.[0] ||
10 event.location?.match(/https:\/\/zoom.us\/j\/\d+/)?.[0];