MCPcopy Index your code
hub / github.com/simstudioai/sim / resolveResponseCap

Function resolveResponseCap

apps/sim/connectors/google-forms/google-forms.ts:154–157  ·  view source on GitHub ↗

* 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>)

Source from the content-addressed store, hash-verified

152 * cap re-syncs every form (the rendered content depends on it).
153 */
154function 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.

Callers 1

google-forms.tsFile · 0.85

Calls 1

parsePositiveIntFunction · 0.85

Tested by

no test coverage detected