* Resolves the effective per-form response cap applied when rendering content: * the user-configured `maxResponsesPerForm` clamped to the hard * `MAX_RESPONSES_PER_FORM` ceiling. Part of the content hash so changing the * cap re-syncs every form (the rendered content depends on it).
(sourceConfig: Record<string, unknown>)
| 152 | * cap re-syncs every form (the rendered content depends on it). |
| 153 | */ |
| 154 | function resolveResponseCap(sourceConfig: Record<string, unknown>): number { |
| 155 | const configured = parsePositiveInt(sourceConfig.maxResponsesPerForm) |
| 156 | return configured > 0 ? Math.min(configured, MAX_RESPONSES_PER_FORM) : MAX_RESPONSES_PER_FORM |
| 157 | } |
| 158 | |
| 159 | /** |
| 160 | * Parses an optional positive-integer config value, returning 0 when unset/invalid. |
no test coverage detected