index.js
function validateOptions (options) {
  if (typeof options.apiKey !== 'string') {
    throw new Error('You must provide a valid API key to upload sourcemaps to Bugsnag.')
  }
  if (typeof options.sourceMap !== 'string') {
    throw new Error('You must provide a path to the source map you want to upload.')
  }
  if (options.addWildcardPrefix && !options.stripProjectRoot) {
    options.stripProjectRoot = true
  }
  if (options.uploadSources && !options.projectRoot) {
    throw new Error('You must provide a project root when uploading sources. ' +
      'The project root is used to generate relative paths to the sources.')
  }
  if (options.stripProjectRoot && !options.projectRoot) {
    throw new Error('You must provide a project root when stripping the root ' +
      'path from the source map.')
  }
  if (options.projectRoot && !path.isAbsolute(options.projectRoot)) {
    options.projectRoot = path.resolve(options.projectRoot)
  }
  return options
}
function validateOptions (options) {
  if (typeof options.apiKey !== 'string') {
    throw new Error('You must provide a valid API key to upload sourcemaps to Bugsnag.')
  }
  if (typeof options.sourceMap !== 'string') {
    throw new Error('You must provide a path to the source map you want to upload.')
  }
  if (options.addWildcardPrefix && !options.stripProjectRoot) {
    options.stripProjectRoot = true
  }
  if (options.uploadSources && !options.projectRoot) {
    throw new Error('You must provide a project root when uploading sources. ' +
      'The project root is used to generate relative paths to the sources.')
  }
  if (options.stripProjectRoot && !options.projectRoot) {
    throw new Error('You must provide a project root when stripping the root ' +
      'path from the source map.')
  }
  if (options.projectRoot && !path.isAbsolute(options.projectRoot)) {
    options.projectRoot = path.resolve(options.projectRoot)
  }
  return options
}
function validateOptions ( options ) { if ( typeof options . apiKey !== 'string' ) { throw new Error ( 'You must provide a valid API key to upload sourcemaps to Bugsnag.' ) } if ( typeof options . sourceMap !== 'string' ) { throw new Error ( 'You must provide a path to the source map you want to upload.' ) } if ( options . addWildcardPrefix && ! options . stripProjectRoot ) { options . stripProjectRoot = true } if ( options . uploadSources && ! options . projectRoot ) { throw new Error ( 'You must provide a project root when uploading sources. ' + 'The project root is used to generate relative paths to the sources.' ) } if ( options . stripProjectRoot && ! options . projectRoot ) { throw new Error ( 'You must provide a project root when stripping the root ' + 'path from the source map.' ) } if ( options . projectRoot && ! path . isAbsolute ( options . projectRoot ) ) { options . projectRoot = path . resolve ( options . projectRoot ) } return options }
Checks that the any required options are present and are not malformed. Some options also
depend on each other in order to function correctly. Throws an error when there's a voilation.

@param {object} options The options
@returns {object}
Checks that the any required options are present and are not malformed . Some options also depend on each other in order to function correctly . Throws an error when there s a voilation .