MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / hasMidStringWildcard

Function hasMidStringWildcard

packages/cli/src/commands/lambda/policies.ts:381–388  ·  view source on GitHub ↗
(pattern: string)

Source from the content-addressed store, hash-verified

379}
380
381function hasMidStringWildcard(pattern: string): boolean {
382 // Wildcards we DO support: bare `*`, `service:*`, `prefix*` (single
383 // trailing `*`). Anything else (mid-string `*` or `?`) is mid-string.
384 if (pattern === "*") return false;
385 if (pattern.endsWith(":*")) return false;
386 if (pattern.endsWith("*") && !pattern.slice(0, -1).includes("*")) return false;
387 return pattern.includes("*") || pattern.includes("?");
388}
389
390function actionMatches(pattern: string, action: string): boolean {
391 if (pattern === "*") return true;

Callers 1

validatePolicyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected