bugsnag/bugsnag-js

View on GitHub
packages/plugin-stackframe-path-normaliser/path-normaliser.js

Summary

Maintainability
A
0 mins
Test Coverage
module.exports = {
  load (client) {
    client.addOnError(event => {
      const allFrames = event.errors.reduce((accum, er) => accum.concat(er.stacktrace), [])

      allFrames.forEach(stackframe => {
        if (typeof stackframe.file !== 'string') {
          return
        }

        stackframe.file = stackframe.file.replace(/\\/g, '/')
      })
    })
  }
}