MCPcopy Create free account
hub / github.com/vercel/vercel / topicPatternToRegex

Function topicPatternToRegex

packages/cli/src/util/dev/queue-broker.ts:65–68  ·  view source on GitHub ↗
(pattern: string)

Source from the content-addressed store, hash-verified

63 * `*` expands to match zero or more valid topic characters.
64 */
65export function topicPatternToRegex(pattern: string): RegExp {
66 const parts = pattern.split('*').map(s => s.replace(/-/g, '\\-'));
67 return new RegExp(`^${parts.join('[A-Za-z0-9_\\-]*')}$`);
68}
69
70export interface EnqueueOptions {
71 retentionSeconds?: number;

Callers 2

constructorMethod · 0.85

Calls 3

splitMethod · 0.80
replaceMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected