<commit_before>import config from './config'

export const warn = function (message) {
  /* eslint-disable */
  console.warn(`[VueAnalytics] ${message}`)
  /* eslint-enable */
}
/**
 * Google Analytics script loader
 * it auto adds Google Analytics script without needs to modify the HTML page.
 * @param  {String} id Google Analytics ID
 * @return {Promise}
 */
export const loadScript = function (id) {
  return new Promise((resolve, reject) => {
    let script = document.createElement('script')
    const prior = document.getElementsByTagName('script')[0]

    script.async = 1

    prior.parentNode.insertBefore(script, prior)

    script.onload = script.onreadystatechange = function (_, isAbort) {
      if (isAbort || !script.readyState || /loaded|complete/.test(script.readyState)) {
        script.onload = script.onreadystatechange = null
        script = undefined

        if (isAbort) {
          reject({ error: true })
          return
        }

        window.ga('create', id, 'auto')

        resolve({ success: true, id })
      }
    }
    script.src = '//www.google-analytics.com/analytics.js'
  })
}

/**
 * Returns if a string exists in the array of routes
 * @param  {String} name
 * @return {Boolean}
 */
export const exists = function (name) {
  return !!(config.ignoreRoutes.length && config.ignoreRoutes.indexOf(name) !== -1)
}<commit_msg>style(code): style code changes<commit_after>import config from './config'

/**
 * Whining helper
 * @param  {String} message
 */
export const warn = function (message) {
  /* eslint-disable */
  console.warn(`[VueAnalytics] ${message}`)
  /* eslint-enable */
}

/**
 * Google Analytics script loader
 * it auto adds Google Analytics script without needs to modify the HTML page.
 * @param  {String} id Google Analytics ID
 * @return {Promise}
 */
export const loadScript = function (id) {
  return new Promise((resolve, reject) => {
    let script = document.createElement('script')
    const prior = document.getElementsByTagName('script')[0]

    script.async = 1
    prior.parentNode.insertBefore(script, prior)

    script.onload = script.onreadystatechange = function (_, isAbort) {
      if (isAbort || !script.readyState || /loaded|complete/.test(script.readyState)) {
        script.onload = script.onreadystatechange = null
        script = undefined

        if (isAbort) {
          reject({ error: true })
          return
        }

        window.ga('create', id, 'auto')

        resolve({ success: true, id })
      }
    }

    script.src = '//www.google-analytics.com/analytics.js'
  })
}

/**
 * Returns if a string exists in the array of routes
 * @param  {String} name
 * @return {Boolean}
 */
export const exists = function (name) {
  return !!(config.ignoreRoutes.length && config.ignoreRoutes.indexOf(name) !== -1)
}
{'fraction_non_alphanumeric': 0.13563545745817016, 'fraction_numerical': 0.002135991456034176, 'mean_word_length': 3.0373563218390807, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2167643', 'n_tokens_mistral': 842, 'n_tokens_neox': 818, 'n_words': 226}