lib/request.js
function handleReq(config) {
  var authCheck = csrfTokenCheck();

  return function (options, callback) {
    if (callback) {
      authCheck({ config: config, options: options, callback: callback });
    } else {
      return new Promise(function (resolve, reject) {
        authCheck({
          config: config,
          options: options,
          callback: function callback(err, res) {
            return err ? reject(err) : resolve(res);
          }
        });
      });
    }
  };
}
function handleReq(config) {
  var authCheck = csrfTokenCheck();

  return function (options, callback) {
    if (callback) {
      authCheck({ config: config, options: options, callback: callback });
    } else {
      return new Promise(function (resolve, reject) {
        authCheck({
          config: config,
          options: options,
          callback: function callback(err, res) {
            return err ? reject(err) : resolve(res);
          }
        });
      });
    }
  };
}
function handleReq ( config ) { var authCheck = csrfTokenCheck ( ) ; return function ( options , callback ) { if ( callback ) { authCheck ( { config : config , options : options , callback : callback } ) ; } else { return new Promise ( function ( resolve , reject ) { authCheck ( { config : config , options : options , callback : function callback ( err , res ) { return err ? reject ( err ) : resolve ( res ) ; } } ) ; } ) ; } } ; }
Wrap in a promise if expected
Wrap in a promise if expected