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

Function sanitizeLimit

apps/sim/tools/monday/utils.ts:28–32  ·  view source on GitHub ↗
(value: number | undefined, defaultVal: number, max: number)

Source from the content-addressed store, hash-verified

26 * Coerces a limit/page param to a safe integer within bounds.
27 */
28export 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

Callers 3

search_items.tsFile · 0.90
get_items.tsFile · 0.90
list_boards.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected