function parse(cfg) {
  if (typeof cfg !== 'object') {
    throw new Error('Config is not an object');
  }

  const config = cfg;

  /**
   * Pull config from ENV if set
   */
  if (process.env.SLACK_TOKEN) {
    config.slack.token = process.env.SLACK_TOKEN;
  }

  if (process.env.SLACK_AUTO_RECONNECT) {
    config.slack.autoReconnect = parseBool(process.env.SLACK_AUTO_RECONNECT);
  }

  if (process.env.MONGODB_URL) {
    config.db.url = process.env.MONGODB_URL;
  }

  return config;
}
/**
 * Parses and enhances config object
 *
 * @param  {object} cfg the raw object from file
 * @return {object}     the paresed config object
 * @throws Error if it cannot parse object
 */
Parses and enhances config object
@param  {object} cfg the raw object from file
@return {object}     the paresed config object
@throws Error if it cannot parse object
Parses and enhances config object @param { object } cfg the raw object from file @return { object } the paresed config object @throws Error if it cannot parse object
function parse(cfg) {
  if (typeof cfg !== 'object') {
    throw new Error('Config is not an object');
  }
  const config = cfg;
  if (process.env.SLACK_TOKEN) {
    config.slack.token = process.env.SLACK_TOKEN;
  }
  if (process.env.SLACK_AUTO_RECONNECT) {
    config.slack.autoReconnect = parseBool(process.env.SLACK_AUTO_RECONNECT);
  }
  if (process.env.MONGODB_URL) {
    config.db.url = process.env.MONGODB_URL;
  }
  return config;
}
function parse ( cfg ) { if ( typeof cfg !== 'object' ) { throw new Error ( 'Config is not an object' ) ; } const config = cfg ; if ( process . env . SLACK_TOKEN ) { config . slack . token = process . env . SLACK_TOKEN ; } if ( process . env . SLACK_AUTO_RECONNECT ) { config . slack . autoReconnect = parseBool ( process . env . SLACK_AUTO_RECONNECT ) ; } if ( process . env . MONGODB_URL ) { config . db . url = process . env . MONGODB_URL ; } return config ; }
Parses and enhances config object
 @param  {object} cfg the raw object from file
 @return {object}     the paresed config object
 @throws Error if it cannot parse object
Parses and enhances config object @param { object } cfg the raw object from file @return { object } the paresed config object @throws Error if it cannot parse object
/**
   * Pull config from ENV if set
   */