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

Function validateWebhookEvents

packages/cli/src/util/webhooks/get-webhook-events.ts:51–63  ·  view source on GitHub ↗
(
  events: string[]
)

Source from the content-addressed store, hash-verified

49 * Returns an array of invalid event names.
50 */
51export async function validateWebhookEvents(
52 events: string[]
53): Promise<string[]> {
54 const validEvents = await getWebhookEvents();
55
56 // If we couldn't fetch valid events, skip validation
57 if (validEvents.length === 0) {
58 return [];
59 }
60
61 const validSet = new Set(validEvents);
62 return events.filter(e => !validSet.has(e));
63}

Callers 1

createFunction · 0.90

Calls 3

getWebhookEventsFunction · 0.85
filterMethod · 0.80
hasMethod · 0.45

Tested by

no test coverage detected