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

Function getSearchLimit

apps/docs/app/api/search/route.ts:12–20  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

10const MAX_SEARCH_LIMIT = 20
11
12function getSearchLimit(value: unknown): number {
13 const limit = Number.parseInt(String(value ?? DEFAULT_SEARCH_LIMIT), 10)
14
15 if (!Number.isFinite(limit) || limit <= 0) {
16 return DEFAULT_SEARCH_LIMIT
17 }
18
19 return Math.min(limit, MAX_SEARCH_LIMIT)
20}
21
22function getSearchParams(request: NextRequest) {
23 const searchParams = request.nextUrl.searchParams

Callers 1

getSearchParamsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected