MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / patternSubsumes

Function patternSubsumes

packages/plugins/toolkits/src/page.tsx:249–254  ·  view source on GitHub ↗
(candidate: string, covered: string)

Source from the content-addressed store, hash-verified

247};
248
249const patternSubsumes = (candidate: string, covered: string): boolean => {
250 if (candidate === covered) return true;
251 if (!candidate.endsWith(".*")) return false;
252 const prefix = candidate.slice(0, -1);
253 return covered.startsWith(prefix);
254};
255
256const reducePolicyPatterns = (patterns: readonly string[]): readonly string[] => {
257 const unique = [...new Set(patterns)].sort((a, b) => a.localeCompare(b));

Callers 1

reducePolicyPatternsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected