lib/src/options.js
function _getUserOption(userOptions, optToGet, isBool) {
  const envVar = `MOCHAWESOME_${optToGet.toUpperCase()}`;
  if (userOptions && typeof userOptions[optToGet] !== 'undefined') {
    return (isBool && typeof userOptions[optToGet] === 'string')
      ? userOptions[optToGet] === 'true'
      : userOptions[optToGet];
  }
  if (typeof process.env[envVar] !== 'undefined') {
    return isBool
      ? process.env[envVar] === 'true'
      : process.env[envVar];
  }
  return undefined;
}
function _getUserOption(userOptions, optToGet, isBool) {
  const envVar = `MOCHAWESOME_${optToGet.toUpperCase()}`;
  if (userOptions && typeof userOptions[optToGet] !== 'undefined') {
    return (isBool && typeof userOptions[optToGet] === 'string')
      ? userOptions[optToGet] === 'true'
      : userOptions[optToGet];
  }
  if (typeof process.env[envVar] !== 'undefined') {
    return isBool
      ? process.env[envVar] === 'true'
      : process.env[envVar];
  }
  return undefined;
}
function _getUserOption ( userOptions , optToGet , isBool ) { const envVar = ` ${ optToGet . toUpperCase ( ) } ` ; if ( userOptions && typeof userOptions [ optToGet ] !== 'undefined' ) { return ( isBool && typeof userOptions [ optToGet ] === 'string' ) ? userOptions [ optToGet ] === 'true' : userOptions [ optToGet ] ; } if ( typeof process . env [ envVar ] !== 'undefined' ) { return isBool ? process . env [ envVar ] === 'true' : process . env [ envVar ] ; } return undefined ; }
Retrieve the value of a user supplied option.
Order of precedence
1. User-supplied option
2. Environment variable

@param {object}  userOptions  Options to parse through
@param {string}  optToGet     Option name
@param {boolean} isBool       Treat option as Boolean

@return {string|boolean|undefined}  Option value
Retrieve the value of a user supplied option . Order of precedence 1 . User - supplied option 2 . Environment variable