MCPcopy Create free account
hub / github.com/TanStack/ai / parseIssueUrl

Function parseIssueUrl

examples/ts-react-chat/src/sandbox-triage.ts:34–49  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

32
33/** GitHub issue URL → repo + issue number. Throws on anything that isn't an issue URL. */
34export function parseIssueUrl(url: string): {
35 repo: string
36 issueNumber: number
37} {
38 const match = url
39 .trim()
40 .match(
41 /^https?:\/\/github\.com\/([^/]+)\/([^/]+)\/issues\/(\d+)(?:[/?#].*)?$/i,
42 )
43 if (!match) {
44 throw new Error(
45 'Enter a GitHub issue URL like https://github.com/owner/repo/issues/123',
46 )
47 }
48 return { repo: `${match[1]}/${match[2]}`, issueNumber: Number(match[3]) }
49}
50
51const WORKDIR = '/workspace'
52const SANDBOX_IMAGE = process.env.SANDBOX_IMAGE ?? 'node:22'

Callers 2

triagePostFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected