(name: string, value: unknown)
| 202 | } |
| 203 | |
| 204 | function 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 | |
| 220 | function parseTriggerDefaults( |
| 221 | subscriber: string, |
no test coverage detected