<commit_before>module.exports = {

  getVote: function (req, callback){
    if(!(req.body && req.body.amendment && req.body.signature)){
      callback('Requires an amendment + signature');
      return;
    }
    callback(null, req.body.amendment + req.body.signature);
  },

  getAmendmentID: function (req, callback) {
    if(!req.params.amendment_id){
      callback("Amendment ID is required");
      return;
    }
    var matches = req.params.amendment_id.match(/^(\d+)-(\w{40})$/);
    if(!matches){
      callback("Amendment ID format is incorrect, must be 'number-hash'");
      return;
    }
    callback(null, matches[1], matches[2]);
  },

  getAmendmentNumber: function (req, callback) {
    if(!req.params.amendment_number){
      callback("Amendment number is required");
      return;
    }
    var matches = req.params.amendment_number.match(/^(\d+)$/);
    if(!matches){
      callback("Amendment number format is incorrect, must be an integer value");
      return;
    }
    callback(null, matches[1]);
  },

  getMembership: function (req, callback) {
    // Parameters
    if(!(req.body && req.body.request && req.body.signature)){
      callback('Requires a membership request + signature');
      return;
    }
    callback(null, req.body.request + req.body.signature);
  }
}<commit_msg>Fix: bad parameter on /promoted make server crashing<commit_after>module.exports = {

  getVote: function (req, callback){
    if(!(req.body && req.body.amendment && req.body.signature)){
      callback('Requires an amendment + signature');
      return;
    }
    callback(null, req.body.amendment + req.body.signature);
  },

  getAmendmentID: function (req, callback) {
    if(!req.params || !req.params.amendment_id){
      callback("Amendment ID is required");
      return;
    }
    var matches = req.params.amendment_id.match(/^(\d+)-(\w{40})$/);
    if(!matches){
      callback("Amendment ID format is incorrect, must be 'number-hash'");
      return;
    }
    callback(null, matches[1], matches[2]);
  },

  getAmendmentNumber: function (req, callback) {
    if(!req.params || !req.params.amendment_number){
      callback("Amendment number is required");
      return;
    }
    var matches = req.params.amendment_number.match(/^(\d+)$/);
    if(!matches){
      callback("Amendment number format is incorrect, must be an integer value");
      return;
    }
    callback(null, matches[1]);
  },

  getMembership: function (req, callback) {
    // Parameters
    if(!(req.body && req.body.request && req.body.signature)){
      callback('Requires a membership request + signature');
      return;
    }
    callback(null, req.body.request + req.body.signature);
  }
}
{'fraction_non_alphanumeric': 0.15533259011519882, 'fraction_numerical': 0.0037160906726124115, 'mean_word_length': 3.1099236641221375, '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': '3723284', 'n_tokens_mistral': 830, 'n_tokens_neox': 815, 'n_words': 181}