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

module.exports = function getApp (apps, fullPath, basePath) {
  if (path.extname(fullPath)) {
    fullPath = path.dirname(fullPath) + '/'
  }
  var splitPath = fullPath.split('/')
  var testPath
  while (testPath !== basePath) {
    testPath = splitPath.join('/')
    if (apps[testPath]) {
      return apps[testPath]
    }
    splitPath.pop()
  }
}<commit_msg>now compiling and serving the right indexed<commit_after>var path = require('path')

module.exports = function getApp (apps, fullPath, basePath) {
  if (path.extname(fullPath)) {
    fullPath = path.dirname(fullPath)
  }
  if (!fullPath.endsWith('/')) {
    fullPath += '/'
  }
  if (!basePath.endsWith('/')) {
    basePath += '/'
  }
  var splitPath = fullPath.split('/')
  var testPath
  while (testPath !== basePath) {
    testPath = splitPath.join('/') + '/'
    if (apps[testPath]) {
      return apps[testPath]
    }
    splitPath.pop()
  }
}
{'fraction_non_alphanumeric': 0.16596638655462184, 'fraction_numerical': 0.0, 'mean_word_length': 3.2355555555555555, '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': '2357358', 'n_tokens_mistral': 327, 'n_tokens_neox': 323, 'n_words': 68}