MCPcopy
hub / github.com/codeaashu/claude-code / formatSourceForDisplay

Function formatSourceForDisplay

src/utils/plugins/marketplaceHelpers.ts:510–533  ·  view source on GitHub ↗
(source: MarketplaceSource)

Source from the content-addressed store, hash-verified

508 * Format a MarketplaceSource for display in error messages
509 */
510export function formatSourceForDisplay(source: MarketplaceSource): string {
511 switch (source.source) {
512 case 'github':
513 return `github:${source.repo}${source.ref ? `@${source.ref}` : ''}`
514 case 'url':
515 return source.url
516 case 'git':
517 return `git:${source.url}${source.ref ? `@${source.ref}` : ''}`
518 case 'npm':
519 return `npm:${source.package}`
520 case 'file':
521 return `file:${source.path}`
522 case 'directory':
523 return `dir:${source.path}`
524 case 'hostPattern':
525 return `hostPattern:${source.hostPattern}`
526 case 'pathPattern':
527 return `pathPattern:${source.pathPattern}`
528 case 'settings':
529 return `settings:${source.name} (${source.plugins.length} ${plural(source.plugins.length, 'plugin')})`
530 default:
531 return 'unknown source'
532 }
533}
534
535/**
536 * Reasons why no marketplaces are available in the Discover screen

Callers 2

addMarketplaceSourceFunction · 0.85

Calls 1

pluralFunction · 0.85

Tested by

no test coverage detected