(value: string | undefined)
| 154 | } |
| 155 | |
| 156 | function sanitize(value: string | undefined): string | undefined { |
| 157 | if (!value) return undefined |
| 158 | // only allow alphanumeric, dash, underscore, slash, dot |
| 159 | const sanitized = value.replace(/[^a-zA-Z0-9\-_/.]/g, "").slice(0, 100) |
| 160 | return sanitized || undefined |
| 161 | } |