(offset)
| 9 | } |
| 10 | |
| 11 | function 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 | |
| 18 | function paginate(items, limitNum, offsetNum) { |
| 19 | if (typeof limitNum === 'number') { |