MCPcopy Create free account
hub / github.com/codeaashu/claude-code / blockedConstraintMatches

Function blockedConstraintMatches

src/utils/plugins/marketplaceHelpers.ts:371–381  ·  view source on GitHub ↗

* Check if a blocked ref/path constraint matches a source. * If the blocklist entry has no ref/path, it matches ALL refs/paths (wildcard). * If the blocklist entry has a specific ref/path, it only matches that exact value.

(
  blockedValue: string | undefined,
  sourceValue: string | undefined,
)

Source from the content-addressed store, hash-verified

369 * If the blocklist entry has a specific ref/path, it only matches that exact value.
370 */
371function blockedConstraintMatches(
372 blockedValue: string | undefined,
373 sourceValue: string | undefined,
374): boolean {
375 // If blocklist doesn't specify a constraint, it's a wildcard - matches anything
376 if (!blockedValue) {
377 return true
378 }
379 // If blocklist specifies a constraint, source must match exactly
380 return (blockedValue || undefined) === (sourceValue || undefined)
381}
382
383/**
384 * Check if two sources refer to the same GitHub repository, even if using

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected