MCPcopy Create free account
hub / github.com/amrkmn/x / parseSourceUrlExt

Function parseSourceUrlExt

tests/extensions-source.test.ts:99–106  ·  view source on GitHub ↗
(source: string)

Source from the content-addressed store, hash-verified

97
98// Minimal inline copy of parseSourceUrl since it's module-private
99function parseSourceUrlExt(source: string): { url: string; branch?: string } {
100 const idx = source.lastIndexOf('@');
101 if (idx === -1) return { url: source };
102 const url = source.slice(0, idx);
103 const branch = source.slice(idx + 1);
104 if (!branch) return { url };
105 return { url, branch };
106}
107
108test('parseSourceUrl handles various URL patterns', () => {
109 // No @ — returns URL unchanged

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected