<commit_before>'use babel'

import { dirname, basename } from 'path'

function getPath (path) {
  let [projectPath, filePath] = atom.project.relativizePath(path)

  if (!projectPath) {
    projectPath = dirname(filePath)
    filePath = basename(filePath)
  }

  return { projectPath, filePath }
}

function getActiveFile () {
  let editor = atom.workspace.getActivePaneItem()
    if (editor) {
      if (editor.file) {
        return editor.file.path
      } else if (editor.buffer && editor.buffer.file) {
        return editor.buffer.file.path
      }
    }
}

function getUserConfig (projectPath) {
  try {
    return require(projectPath + '/bs-config.js')
  } catch(err) {
    return {}
  }
}

function onlineConfig (value) {
  switch (value) {
    case 0:
      return false
      break;
    case 1:
      return undefined
      break;
    case 2:
      return true
      break;
  }
}

export { getPath, getActiveFile, getUserConfig, onlineConfig }
<commit_msg>Convert path to string<commit_after>'use babel'

import { dirname, basename } from 'path'

function getPath (path) {
  let [projectPath, filePath] = atom.project.relativizePath(path)

  if (!projectPath) {
    projectPath = dirname(filePath.toString())
    filePath = basename(filePath.toString())
  }

  return { projectPath, filePath }
}

function getActiveFile () {
  let editor = atom.workspace.getActivePaneItem()
    if (editor) {
      if (editor.file) {
        return editor.file.path
      } else if (editor.buffer && editor.buffer.file) {
        return editor.buffer.file.path
      }
    }
}

function getUserConfig (projectPath) {
  try {
    return require(projectPath + '/bs-config.js')
  } catch(err) {
    return {}
  }
}

function onlineConfig (value) {
  switch (value) {
    case 0:
      return false
      break;
    case 1:
      return undefined
      break;
    case 2:
      return true
      break;
  }
}

export { getPath, getActiveFile, getUserConfig, onlineConfig }

{'fraction_non_alphanumeric': 0.11207335710646969, 'fraction_numerical': 0.003056546102903719, 'mean_word_length': 2.7338403041825097, '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': '2793248', 'n_tokens_mistral': 638, 'n_tokens_neox': 627, 'n_words': 151}