normalizeContextOptions(givenContextOptions) {

    let cOptions = givenContextOptions || {};

    // by default we do not bypass authentication
    cOptions.bypassAuth = u.thisOrThat(cOptions.bypassAuth, false);

    // decode html enntities for this call?
    cOptions.decodeHtmlEntities = u.thisOrThat(cOptions.decodeHtmlEntities,
                                               this._userConfig.decodeHtmlEntities);

    // how many attempts left do we have to retry an endpoint?

    // use the given retryAttemptsLeft, or the retryAttempts passed in the
    // context options if not specified
    cOptions.retryAttemptsLeft = u.thisOrThat(cOptions.retryAttemptsLeft,
                                              cOptions.retryAttempts);

    // use the given retryAttemptsLeft, or the retryAttempts passed in the
    // user configuration
    cOptions.retryAttemptsLeft = u.thisOrThat(cOptions.retryAttemptsLeft,
                                              this._userConfig.retryAttempts);

    // delay between retrying an endpoint
    cOptions.retryDelay = u.thisOrThat(cOptions.retryDelay,
                                       this._userConfig.retryDelay);

    // milliseconds before a request times out
    cOptions.requestTimeout = u.thisOrThat(cOptions.requestTimeout,
                                           this._userConfig.requestTimeout);

    // how many reauthentication attempts do we have left?
    cOptions.reauthAttemptsLeft = u.thisOrThat(cOptions.reauthAttemptsLeft,
                                               cOptions.retryAttemptsLeft);

    return cOptions;
  }
/*
     Returns a set of options that effect how each call to reddit behaves.
   */
Returns a set of options that effect how each call to reddit behaves.
Returns a set of options that effect how each call to reddit behaves .
normalizeContextOptions(givenContextOptions) {
    let cOptions = givenContextOptions || {};
    cOptions.bypassAuth = u.thisOrThat(cOptions.bypassAuth, false);
    cOptions.decodeHtmlEntities = u.thisOrThat(cOptions.decodeHtmlEntities,
                                               this._userConfig.decodeHtmlEntities);
    cOptions.retryAttemptsLeft = u.thisOrThat(cOptions.retryAttemptsLeft,
                                              cOptions.retryAttempts);
    cOptions.retryAttemptsLeft = u.thisOrThat(cOptions.retryAttemptsLeft,
                                              this._userConfig.retryAttempts);
    cOptions.retryDelay = u.thisOrThat(cOptions.retryDelay,
                                       this._userConfig.retryDelay);
    cOptions.requestTimeout = u.thisOrThat(cOptions.requestTimeout,
                                           this._userConfig.requestTimeout);
    cOptions.reauthAttemptsLeft = u.thisOrThat(cOptions.reauthAttemptsLeft,
                                               cOptions.retryAttemptsLeft);
    return cOptions;
  }
normalizeContextOptions ( givenContextOptions ) { let cOptions = givenContextOptions || { } ; cOptions . bypassAuth = u . thisOrThat ( cOptions . bypassAuth , false ) ; cOptions . decodeHtmlEntities = u . thisOrThat ( cOptions . decodeHtmlEntities , this . _userConfig . decodeHtmlEntities ) ; cOptions . retryAttemptsLeft = u . thisOrThat ( cOptions . retryAttemptsLeft , cOptions . retryAttempts ) ; cOptions . retryAttemptsLeft = u . thisOrThat ( cOptions . retryAttemptsLeft , this . _userConfig . retryAttempts ) ; cOptions . retryDelay = u . thisOrThat ( cOptions . retryDelay , this . _userConfig . retryDelay ) ; cOptions . requestTimeout = u . thisOrThat ( cOptions . requestTimeout , this . _userConfig . requestTimeout ) ; cOptions . reauthAttemptsLeft = u . thisOrThat ( cOptions . reauthAttemptsLeft , cOptions . retryAttemptsLeft ) ; return cOptions ; }
Returns a set of options that effect how each call to reddit behaves.
Returns a set of options that effect how each call to reddit behaves .
// by default we do not bypass authentication // decode html enntities for this call? // how many attempts left do we have to retry an endpoint? // use the given retryAttemptsLeft, or the retryAttempts passed in the // context options if not specified // use the given retryAttemptsLeft, or the retryAttempts passed in the // user configuration // delay between retrying an endpoint // milliseconds before a request times out // how many reauthentication attempts do we have left?