<commit_before>var path = require('path')
var fs = require('fs')

module.exports = function (dir1, dir2) {
  var expanded = path.resolve(dir1, dir2.replace(/\:/g, '/'))
  if (isDir(expanded)) {
    if (containsIndexFile(expanded)) {
      return expanded + '/index*'
    } else {
      return expanded + '/*'
    }
  } else {
    return expanded + '*'
  }
}

function isDir (f) {
  try {
    return fs.statSync(f).isDirectory()
  } catch (e) {}
}

function containsIndexFile (f) {
  try {
    return fs.statSync(f + '/index').isFile()
  } catch (e) {}
}<commit_msg>Fix obvious forward-slashing that'll break windows<commit_after>var path = require('path')
var fs = require('fs')

module.exports = function (dir1, dir2) {
  var expanded = path.resolve(dir1, path.join.apply(this, dir2.split(':')))
  if (isDir(expanded)) {
    if (containsIndexFile(expanded)) {
      return path.join(expanded, '/index') + '*'
    } else {
      return path.join(expanded, '/') + '*'
    }
  } else {
    return expanded + '*'
  }
}

function isDir (f) {
  try {
    return fs.statSync(f).isDirectory()
  } catch (e) {}
}

function containsIndexFile (f) {
  try {
    return fs.statSync(f + '/index').isFile()
  } catch (e) {}
}
{'fraction_non_alphanumeric': 0.18001651527663087, 'fraction_numerical': 0.006606110652353427, 'mean_word_length': 3.1084745762711865, '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': '911549', 'n_tokens_mistral': 438, 'n_tokens_neox': 430, 'n_words': 94}