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

Function parseRepo

apps/sim/connectors/github/github.ts:38–45  ·  view source on GitHub ↗

* Parses the repository string into owner and repo.

(repository: string)

Source from the content-addressed store, hash-verified

36 * Parses the repository string into owner and repo.
37 */
38function parseRepo(repository: string): { owner: string; repo: string } {
39 const cleaned = repository.replace(/^https?:\/\/github\.com\//, '').replace(/\.git$/, '')
40 const parts = cleaned.split('/')
41 if (parts.length < 2 || !parts[0] || !parts[1]) {
42 throw new Error(`Invalid repository format: "${repository}". Use "owner/repo".`)
43 }
44 return { owner: parts[0], repo: parts[1] }
45}
46
47/**
48 * File extension filter set from user config. Returns null if no filter (accept all).

Callers 1

github.tsFile · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected