* 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, )
| 369 | * If the blocklist entry has a specific ref/path, it only matches that exact value. |
| 370 | */ |
| 371 | function 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 |
no outgoing calls
no test coverage detected