12 lines
331 B
TypeScript
12 lines
331 B
TypeScript
import type { DAVObject } from "tsdav";
|
|
|
|
export const sanitizeCalendarObject = (obj: DAVObject) => {
|
|
return obj.data
|
|
.replaceAll("\r\n", "\r")
|
|
.replaceAll("\r", "\r\n")
|
|
.replaceAll(/(; \r\n|;\r\n|\r\n;|\r\n ;)/gm, ";")
|
|
.replaceAll(/(= \r\n|=\r\n|\r\n=|\r\n =)/gm, "=");
|
|
};
|
|
|
|
export default sanitizeCalendarObject;
|