MCPcopy Index your code
hub / github.com/coder/coder / parsePage

Function parsePage

site/src/hooks/usePaginatedQuery.ts:329–332  ·  view source on GitHub ↗
(params: URLSearchParams)

Source from the content-addressed store, hash-verified

327}
328
329function parsePage(params: URLSearchParams): number {
330 const parsed = Number(params.get("page"));
331 return Number.isInteger(parsed) && parsed > 1 ? parsed : 1;
332}
333
334/**
335 * Strips out the page number from a query so that there aren't mismatches

Callers 1

usePaginatedQueryFunction · 0.85

Calls 2

NumberFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected