function addOrUpdateIntegration(
  defaultIntegrationInstance,
  userIntegrations,
  forcedOptions = {},
) {
  return (
    Array.isArray(userIntegrations)
      ? addOrUpdateIntegrationInArray(defaultIntegrationInstance, userIntegrations, forcedOptions)
      : addOrUpdateIntegrationInFunction(
          defaultIntegrationInstance,
          // Somehow TS can't figure out that not being an array makes this necessarily a function
          userIntegrations ,
          forcedOptions,
        )
  ) ;
}
Enforces inclusion of a given integration with specified options in an integration array originally determined by the
user, by either including the given default instance or by patching an existing user instance with the given options.

Ideally this would happen when integrations are set up, but there isn't currently a mechanism there for merging
options from a default integration instance with those from a user-provided instance of the same integration, only
for allowing the user to override a default instance entirely. (TODO: Fix that.)

@param defaultIntegrationInstance An instance of the integration with the correct options already set
@param userIntegrations Integrations defined by the user.
@param forcedOptions Options with which to patch an existing user-derived instance on the integration.
@returns A final integrations array.

@deprecated This will be removed in v8.