( value: string | undefined, field: string, )
| 1 | import { AppError } from '../kernel/errors.ts'; |
| 2 | |
| 3 | export function normalizeOptionalText( |
| 4 | value: string | undefined, |
| 5 | field: string, |
| 6 | ): string | undefined { |
| 7 | if (value === undefined) return undefined; |
| 8 | return requireText(value, field); |
| 9 | } |
| 10 | |
| 11 | export function requireText(value: string | undefined, field: string): string { |
| 12 | const text = value?.trim(); |
no test coverage detected
searching dependent graphs…