(client: Client, integrations: Integration[])
| 75 | * @param withDefault should enable default integrations |
| 76 | */ |
| 77 | export function setupIntegrations(client: Client, integrations: Integration[]): IntegrationIndex { |
| 78 | const integrationIndex: IntegrationIndex = {}; |
| 79 | |
| 80 | integrations.forEach((integration: Integration | undefined) => { |
| 81 | if (integration?.beforeSetup) { |
| 82 | integration.beforeSetup(client); |
| 83 | } |
| 84 | }); |
| 85 | |
| 86 | integrations.forEach((integration: Integration | undefined) => { |
| 87 | // guard against empty provided integrations |
| 88 | if (integration) { |
| 89 | setupIntegration(client, integration, integrationIndex); |
| 90 | } |
| 91 | }); |
| 92 | |
| 93 | return integrationIndex; |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * Execute the `afterAllSetup` hooks of the given integrations. |
no test coverage detected