Use same lock values as mobile clients
[ProtonMail-WebClient.git] / packages / shared / lib / calendar / icsSurgery / vcal.ts
blobce669d2253a77f8b76ed7393fee453c22752668a
1 import { normalize } from '../../helpers/string';
2 import type { VcalStringProperty } from '../../interfaces/calendar';
3 import { ICAL_CALSCALE } from '../constants';
5 export const getSupportedStringValue = (property?: VcalStringProperty) => {
6     const trimmedValue = property?.value?.trim();
7     if (!trimmedValue) {
8         // return undefined for empty strings
9         return;
10     }
11     return trimmedValue;
14 export const getSupportedCalscale = (calscale?: VcalStringProperty) => {
15     if (!calscale) {
16         return ICAL_CALSCALE.GREGORIAN;
17     }
19     return normalize(calscale.value) === normalize(ICAL_CALSCALE.GREGORIAN) ? ICAL_CALSCALE.GREGORIAN : undefined;