<commit_before>var stripAnsi = require('strip-ansi')

module.exports = errorHandler
module.exports.render = bundleError

function bundleError (message, cwd, rootDirName) {
  // Everything has to be contained inside this function
  // for it to get stringified correctly. i.e. no require()!
  console.error(message)

  if (typeof document === 'undefined') {
    return
  } else if (!document.body) {
    document.addEventListener('DOMContentLoaded', createErrorBox)
  } else {
    createErrorBox()
  }

  function createErrorBox () {
    var parsed = parseError(message)

    var overlayBox = document.createElement('div')
    css(overlayBox, {
      position: 'fixed',
      width: '100%',
      height: '100%',
      zIndex: '100000000',
      top: '0',
      left: '0',
      padding: '20px',
      margin: '0px',
      'box-sizing': 'border-box',
      background: '#fff',
      display: 'block',
      'font-size': '14px',
      'font-family': 'monospace'
    })

    if (!parsed.format) {
      var pre = document.createElement('pre')
      pre.textContent = message
      css(pre, {
        'word-wrap': 'break-word',
        'white-space': 'pre-wrap',
        'box-sizing': 'border-box',
        margin: '0',
        color: '#ff0000'
      })
      overlayBox.appendChild(pre)
    } else {
      var commonElements = []

      var messageDiv = document.createElement('div')
      commonElements.push(messageDiv)
      messageDiv.textContent = parsed.message
      overlayBox.appendChild(messageDiv)
      css(messageDiv, {
        color: '#ff2e2e',
        'font-size': '16px'
      })

      var pathLocContainer = document.createElement('div')
      css(pathLocContainer, { 'padding-top': '10px' })<commit_msg>reset font weight<commit_after>var stripAnsi = require('strip-ansi')

module.exports = errorHandler
module.exports.render = bundleError

function bundleError (message, cwd, rootDirName) {
  // Everything has to be contained inside this function
  // for it to get stringified correctly. i.e. no require()!
  console.error(message)

  if (typeof document === 'undefined') {
    return
  } else if (!document.body) {
    document.addEventListener('DOMContentLoaded', createErrorBox)
  } else {
    createErrorBox()
  }

  function createErrorBox () {
    var parsed = parseError(message)

    var overlayBox = document.createElement('div')
    css(overlayBox, {
      position: 'fixed',
      width: '100%',
      height: '100%',
      zIndex: '100000000',
      top: '0',
      left: '0',
      padding: '20px',
      margin: '0px',
      'box-sizing': 'border-box',
      background: '#fff',
      display: 'block',
      'font-size': '14px',
      'font-weight': 'normal',
      'font-family': 'monospace'
    })

    if (!parsed.format) {
      var pre = document.createElement('pre')
      pre.textContent = message
      css(pre, {
        'word-wrap': 'break-word',
        'white-space': 'pre-wrap',
        'box-sizing': 'border-box',
        margin: '0',
        color: '#ff0000'
      })
      overlayBox.appendChild(pre)
    } else {
      var commonElements = []

      var messageDiv = document.createElement('div')
      commonElements.push(messageDiv)
      messageDiv.textContent = parsed.message
      overlayBox.appendChild(messageDiv)
      css(messageDiv, {
        color: '#ff2e2e',
        'font-size': '16px'
      })

      var pathLocContainer = document.createElement('div')
      css(pathLocContainer, { 'padding-top': '10px' })
{'fraction_non_alphanumeric': 0.14252807371148862, 'fraction_numerical': 0.019003743161531816, 'mean_word_length': 2.680084745762712, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '7109004', 'n_tokens_mistral': 1099, 'n_tokens_neox': 1044, 'n_words': 238}