<commit_before>var validator = require('validator');

module.exports = function(config, callback){
  var errors = [];
  if (!config.currencies) {
    errors.push({ field: 'currencies', message: 'please provide currencies' });
  }
  if (!config.ripple_address) {
    errors.push({ field: 'ripple_address', message: 'please provide ripple_address' });
  }
  if (!config.ripple_rest_url) {
    errors.push({ field: 'ripple_rest_url', message: 'please provide ripple_rest_url' });
  }
  if (!config.postgres_url) {
    errors.push({ field: 'postgres_url', message: 'please provide postgres_url' });
  }

  if(errors.length > 0){
    callback(errors, null);
  } else {
    callback(null, config);
  }
}<commit_msg>[TEST] postgres URL, ripple-rest URL and ripple address<commit_after>var validator = require('validator');
var UInt160 = require('ripple-lib').UInt160;

module.exports = function(config, callback){

  var errors = [];

  if (!config.currencies) {
    errors.push({ field: 'currencies', message: 'please provide currencies' });
  }
  if (!config.ripple_address) {
    errors.push({ field: 'ripple_address', message: 'please provide ripple_address' });
  }
  if (!config.ripple_rest_url) {
    errors.push({ field: 'ripple_rest_url', message: 'please provide ripple_rest_url' });
  }
  if (!config.postgres_url) {
    errors.push({ field: 'postgres_url', message: 'please provide postgres_url' });
  }

  var validPostgresUrl = validator.isURL(config.postgres_url, {
    protocols: ['postgres']
  });

  var validRippleRestUrl = validator.isURL(config.ripple_rest_url);

  if (!validPostgresUrl){
    errors.push({ field: 'invalid_postgres_url', message: 'please provide a valid postgres_url' });
  }

  if (!validRippleRestUrl){
    errors.push({ field: 'invalid_ripple_rest_url', message: 'please provide a valid ripple_rest_url' });
  }

  if (!UInt160.is_valid(config.ripple_address)) {
    errors.push({ field: 'invalid_ripple_address', message: 'please provide a valid ripple_address' });
  }

  if(errors.length > 0){
    callback(errors, null);
  } else {
    callback(null, config);
  }

}
{'fraction_non_alphanumeric': 0.14916864608076008, 'fraction_numerical': 0.005225653206650831, 'mean_word_length': 4.542105263157895, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7451304', 'n_tokens_mistral': 746, 'n_tokens_neox': 686, 'n_words': 153}