1const trimify = (value: string): string => 2 value?.replace(/\n\n\s*\n/g, "\n\n").trim(); 3 4export default trimify;