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

Function parseNextCursor

apps/sim/connectors/sentry/sentry.ts:194–206  ·  view source on GitHub ↗

* Reads the `cursor` of the `rel="next"` link from a Sentry `Link` header. * * Sentry paginates via the `Link` header: each link is annotated with `rel`, * `results`, and `cursor` attributes, e.g. * ` ; rel="next"; results="true"; cursor="0:100:0"`. * A further

(linkHeader: string | null)

Source from the content-addressed store, hash-verified

192 * which is the canonical token Sentry expects echoed back on the next request.
193 */
194function parseNextCursor(linkHeader: string | null): string | undefined {
195 if (!linkHeader) return undefined
196
197 for (const part of linkHeader.split(',')) {
198 if (!/rel="next"/.test(part)) continue
199 if (!/results="true"/.test(part)) return undefined
200 const cursorMatch = part.match(/cursor="([^"]*)"/)
201 if (cursorMatch) return cursorMatch[1]
202 return undefined
203 }
204
205 return undefined
206}
207
208/**
209 * Builds the metadata-based content hash for an issue.

Callers 1

sentry.tsFile · 0.85

Calls 1

testMethod · 0.80

Tested by

no test coverage detected