<commit_before>'use strict';

module.exports = function(agent){
  return {
    withCookies: function(req){
      agent.attachCookies(req);
      return req;
    },

    saveCookies: function(res){
      agent.saveCookies(res);
      return res;
    }
  };
};
<commit_msg>Prototyped SuperAgentUtils module<commit_after>'use strict';

var SuperAgentUtils = function(agent){
  this.agent = agent;
  this.jwt   = undefined;
};

SuperAgentUtils.prototype.withCookies = function(req){
  this.agent.attachCookies(req);
  return req;
};

SuperAgentUtils.prototype.saveCookies = function(res){
  this.agent.saveCookies(res);
  return res;
};

SuperAgentUtils.prototype.withJWT = function(req){
  req.set('Authorization', 'Bearer ' + this.jwt);
  return req;
};

SuperAgentUtils.prototype.saveJWT = function(res){
  this.jwt = res.body.token;
  return res;
};

module.exports = SuperAgentUtils;

{'fraction_non_alphanumeric': 0.13559322033898305, 'fraction_numerical': 0.0, 'mean_word_length': 4.181286549707602, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2342217', 'n_tokens_mistral': 305, 'n_tokens_neox': 293, 'n_words': 51}