MCPcopy Create free account
hub / github.com/BrasilAPI/BrasilAPI / parseLimit

Function parseLimit

pages/api/tuss/v1/index.js:4–9  ·  view source on GitHub ↗
(limit)

Source from the content-addressed store, hash-verified

2import { getTussTerms, searchTuss } from '@/services/tuss';
3
4function parseLimit(limit) {
5 if (typeof limit !== 'string') return undefined;
6 const n = Number.parseInt(limit, 10);
7 if (Number.isNaN(n) || n <= 0) return undefined;
8 return n;
9}
10
11function parseOffset(offset) {
12 if (typeof offset !== 'string') return 0;

Callers 1

TussSearchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected