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

Function parseOffset

pages/api/tuss/v1/index.js:11–16  ·  view source on GitHub ↗
(offset)

Source from the content-addressed store, hash-verified

9}
10
11function parseOffset(offset) {
12 if (typeof offset !== 'string') return 0;
13 const n = Number.parseInt(offset, 10);
14 if (Number.isNaN(n) || n < 0) return 0;
15 return n;
16}
17
18function paginate(items, limitNum, offsetNum) {
19 if (typeof limitNum === 'number') {

Callers 1

TussSearchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected