<commit_before>var exceptions = require('./lib/exceptions')
var logger = require('./lib/logger')
var utils = require('./lib/utils')
var config = require('./lib/config')
var Instrumentation = require('./instrumentation')
var APIQueue = require('./lib/apiQueue')

function Opbeat () {
  this.isInstalled = false
  this._instrumentation = new Instrumentation()

  config.init()

  var queuedCommands = [];
  if(window._opbeat) {
    queuedCommands = _opbeat.q
  }
  this.apiQueue = new APIQueue(this, queuedCommands)

  _opbeat = this.apiQueue.push
  window._opbeat = _opbeat

  this.install()
}

Opbeat.prototype.VERSION = '0.0.1'

Opbeat.prototype.isPlatformSupport = function () {
  return typeof Array.prototype.forEach === 'function' &&
    typeof JSON.stringify === 'function' &&
    typeof Function.bind === 'function' &&
    utils.isCORSSupported()
}

/*
 * Allow multiple versions of Opbeat to be installed.
 * Strip Opbeat from the global context and returns the instance.
 *
 * @return {Opbeat}
 */
Opbeat.prototype.noConflict = function () {
  window.Opbeat = _opbeat
  return this
}

/*
 * Configure Opbeat with Opbeat.com credentials and other options
 *
 * @param {object} options Optional set of of global options
 * @return {Opbeat}
 */

Opbeat.prototype.config = function (properties) {
  config.setConfig(properties)

  return this
}

/*
 * Installs a global window.onerror error handler<commit_msg>Remove noConflict functionality. No longer needed with new API<commit_after>var exceptions = require('./lib/exceptions')
var logger = require('./lib/logger')
var utils = require('./lib/utils')
var config = require('./lib/config')
var Instrumentation = require('./instrumentation')
var APIQueue = require('./lib/apiQueue')

function Opbeat () {
  this.isInstalled = false
  this._instrumentation = new Instrumentation()

  config.init()

  var queuedCommands = [];
  if(window._opbeat) {
    queuedCommands = _opbeat.q
  }
  this.apiQueue = new APIQueue(this, queuedCommands)

  _opbeat = this.apiQueue.push
  window._opbeat = _opbeat

  this.install()
}

Opbeat.prototype.VERSION = '0.0.1'

Opbeat.prototype.isPlatformSupport = function () {
  return typeof Array.prototype.forEach === 'function' &&
    typeof JSON.stringify === 'function' &&
    typeof Function.bind === 'function' &&
    utils.isCORSSupported()
}

/*
 * Configure Opbeat with Opbeat.com credentials and other options
 *
 * @param {object} options Optional set of of global options
 * @return {Opbeat}
 */

Opbeat.prototype.config = function (properties) {
  config.setConfig(properties)

  return this
}

/*
 * Installs a global window.onerror error handler
{'fraction_non_alphanumeric': 0.12831188493565482, 'fraction_numerical': 0.002271006813020439, 'mean_word_length': 4.024714828897339, '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': '2429857', 'n_tokens_mistral': 799, 'n_tokens_neox': 787, 'n_words': 205}