Skip to content

Commit

Permalink
chore: lint module
Browse files Browse the repository at this point in the history
  • Loading branch information
pooya parsa committed May 7, 2019
1 parent c7cd3b8 commit 8a492fc
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const Integrations = require('@sentry/integrations')

const logger = require('consola').withScope('nuxt:sentry')

const filterDisabledIntegration = (integrations) => Object.keys(integrations).
filter( key => integrations[key])
const filterDisabledIntegration = integrations => Object.keys(integrations)
.filter(key => integrations[key])

module.exports = function sentry(moduleOptions) {
const publicPath = this.options.build.publicPath
Expand All @@ -26,7 +26,7 @@ module.exports = function sentry(moduleOptions) {
ExtraErrorData: {},
ReportingObserver: {},
RewriteFrames: {},
Vue: {attachProps: true}
Vue: { attachProps: true }
},
serverIntegrations: {
Dedupe: {},
Expand Down Expand Up @@ -89,8 +89,11 @@ module.exports = function sentry(moduleOptions) {
...options.clientConfig
},
initialize: options.initialize,
integrations: filterDisabledIntegration(options.clientIntegrations).
reduce( (res, key) => (res[key] = options.clientIntegrations[key], res), {} )
integrations: filterDisabledIntegration(options.clientIntegrations)
.reduce((res, key) => {
res[key] = options.clientIntegrations[key]
return res
}, {})
}
})
}
Expand All @@ -102,8 +105,8 @@ module.exports = function sentry(moduleOptions) {
Sentry.init({
dsn: options.dsn,
...options.serverConfig,
integrations: filterDisabledIntegration(options.serverIntegrations).
map(name => new Integrations[name](options.serverIntegrations[name]))
integrations: filterDisabledIntegration(options.serverIntegrations)
.map(name => new Integrations[name](options.serverIntegrations[name]))
})
}

Expand Down

0 comments on commit 8a492fc

Please sign in to comment.