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

Function resolvePageSize

apps/sim/connectors/x/x.ts:337–341  ·  view source on GitHub ↗

* Clamps the requested page size to the endpoint's valid range and to the number * of posts still needed under the cap. The user-tweets, mentions, and liked-tweets * endpoints require `max_results` ≥ 5; only bookmarks accepts ≥ 1. We always request * at least the endpoint minimum (over-fetch on t

(mode: SyncMode, remaining: number)

Source from the content-addressed store, hash-verified

335 * at least the endpoint minimum (over-fetch on the final page is trimmed afterward).
336 */
337function resolvePageSize(mode: SyncMode, remaining: number): number {
338 const floor = mode === 'bookmarks' ? 1 : MIN_PAGE_SIZE
339 if (remaining <= 0) return POSTS_PER_PAGE
340 return Math.max(floor, Math.min(POSTS_PER_PAGE, remaining))
341}
342
343export const xConnector: ConnectorConfig = {
344 ...xConnectorMeta,

Callers 1

x.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected