File size: 282 Bytes
96e86e5
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
import { z } from "zod";

export function normalizeEscapedLineBreaks(value: string): string {
  return value
    .replace(/\\r\\n/g, "\n")
    .replace(/\\n/g, "\n")
    .replace(/\\r/g, "\n");
}

export const multilineTextSchema = z.string().transform(normalizeEscapedLineBreaks);