nuxt-community / sentry-module

Sentry module for Nuxt 2
https://sentry.nuxtjs.org
MIT License
500 stars 113 forks source link

Issue with arguments being typed as `any` in module configuration #538

Closed rchl closed 1 year ago

rchl commented 1 year ago

With Sentry configuration like:

    sentry: {
        dsn: 'xxx',
        config: {
            beforeSend(event, hint) {
                return event;
            },
        },
    },

The event and hint arguments to beforeSend are typed as any. This is because of usage of DeepPartial:

type DeepPartial<T> = {
  [P in keyof T]?: T[P] extends Array<infer I>
    ? Array<DeepPartial<I>>
    : DeepPartial<T[P]>;
}

type DeepPartialModuleConfiguration = DeepPartial<ModuleConfiguration>

It doesn't happen when DeepPartial is not used.

FYI: @rtibaldo since you've introduced DeepPartial.