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

Function parseTopics

packages/python/src/subscribers.ts:204–218  ·  view source on GitHub ↗
(name: string, value: unknown)

Source from the content-addressed store, hash-verified

202}
203
204function parseTopics(name: string, value: unknown): string[] {
205 if (!Array.isArray(value) || value.length === 0) {
206 throw subscriberError(
207 `subscriber "${name}" must define non-empty array field "topics"`
208 );
209 }
210 for (const topic of value) {
211 if (typeof topic !== 'string' || topic.length === 0) {
212 throw subscriberError(
213 `subscriber "${name}" field "topics" must contain only non-empty strings`
214 );
215 }
216 }
217 return value;
218}
219
220function parseTriggerDefaults(
221 subscriber: string,

Callers 1

parseSubscriberFunction · 0.85

Calls 1

subscriberErrorFunction · 0.85

Tested by

no test coverage detected