(value: number | undefined, defaultVal: number, max: number)
| 26 | * Coerces a limit/page param to a safe integer within bounds. |
| 27 | */ |
| 28 | export function sanitizeLimit(value: number | undefined, defaultVal: number, max: number): number { |
| 29 | const n = Number(value ?? defaultVal) |
| 30 | if (!Number.isFinite(n) || n < 1) return defaultVal |
| 31 | return Math.min(n, max) |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Validates a GraphQL enum literal (e.g., board_kind, column_type) against an |
no outgoing calls
no test coverage detected