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

Function extractPagination

apps/sim/tools/zoominfo/utils.ts:110–128  ·  view source on GitHub ↗
(payload: unknown)

Source from the content-addressed store, hash-verified

108}
109
110export function extractPagination(payload: unknown): {
111 totalResults: number | null
112 currentPage: number | null
113 totalPages: number | null
114} {
115 if (payload && typeof payload === 'object') {
116 const meta = (payload as Record<string, unknown>).meta as
117 | { totalResults?: unknown; page?: { number?: unknown; total?: unknown } }
118 | undefined
119 if (meta) {
120 const totalResults = typeof meta.totalResults === 'number' ? meta.totalResults : null
121 const currentPage =
122 meta.page && typeof meta.page.number === 'number' ? meta.page.number : null
123 const totalPages = meta.page && typeof meta.page.total === 'number' ? meta.page.total : null
124 return { totalResults, currentPage, totalPages }
125 }
126 }
127 return { totalResults: null, currentPage: null, totalPages: null }
128}
129
130export function extractDataArray(payload: unknown): Array<Record<string, unknown>> {
131 if (payload && typeof payload === 'object') {

Callers 4

search_contacts.tsFile · 0.90
search_news.tsFile · 0.90
search_intent.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected