<commit_before>import path from 'path'

const cwd = process.cwd()

const getBase = (file, bases) => bases.filter(base => file.indexOf(base) !== -1)
// eslint-disable-next-line no-confusing-arrow
  .reduce((hit, base) => hit.length > base.length ? hit : base, '')

const resolveTarget = bases => (file, target) => {
  const from = path.join(cwd, getBase(file, bases))

  return path.join(target, path.relative(from, file))
}

export default resolveTarget<commit_msg>refactord naming<commit_after>import path from 'path'

const cwd = process.cwd()

const getBase = (source, bases) => bases.filter(base => source.indexOf(base) !== -1)
// eslint-disable-next-line no-confusing-arrow
  .reduce((hit, base) => hit.length > base.length ? hit : base, '')

const resolveTarget = bases => (source, target) => {
  const from = path.join(cwd, getBase(source, bases))

  return path.join(target, path.relative(from, source))
}

export default resolveTarget
{'fraction_non_alphanumeric': 0.16118769883351008, 'fraction_numerical': 0.0021208907741251328, 'mean_word_length': 4.619047619047619, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '5906663', 'n_tokens_mistral': 309, 'n_tokens_neox': 305, 'n_words': 78}