<commit_before>'use strict';

var dotenv = require('dotenv');
var fs = require('fs');

function difference(arrA, arrB) {
  return arrA.filter(function(a) {
    return arrB.indexOf(a) < 0;
  });
}

module.exports = {
  config: function(options) {
    options = options || {};
    dotenv.load(options);
    var sampleVars = dotenv.parse(fs.readFileSync(options.sample || '.env.example'));
    var missing = difference(Object.keys(sampleVars), Object.keys(process.env));
    if (missing.length > 0) {
      throw new Error('Missing environment variables: ' + missing.join(', '));
    }
    return true;<commit_msg>Ignore empty values in process.env when comparing<commit_after>'use strict';

var dotenv = require('dotenv');
var fs = require('fs');

function difference(arrA, arrB) {
  return arrA.filter(function(a) {
    return arrB.indexOf(a) < 0;
  });
}

function compact(obj) {
  var result = {};
  Object.keys(obj).forEach(function(key) {
    if (obj[key]) {
      result[key] = obj[key];
    }
  });
  return result;
}

module.exports = {
  config: function(options) {
    options = options || {};
    dotenv.load(options);
    var sampleVars = dotenv.parse(fs.readFileSync(options.sample || '.env.example'));
    var missing = difference(Object.keys(sampleVars), Object.keys(compact(process.env)));
    if (missing.length > 0) {
      throw new Error('Missing environment variables: ' + missing.join(', '));
    }
    return true;
{'fraction_non_alphanumeric': 0.16376306620209058, 'fraction_numerical': 0.0027874564459930314, 'mean_word_length': 3.802675585284281, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1098808', 'n_tokens_mistral': 460, 'n_tokens_neox': 457, 'n_words': 98}