<commit_before>require('./internal/compat')
merge = require('./internal/merge')
Promise = require('./internal/promise')


class Client
  constructor: (opts={}) ->
    @_projectId = opts.projectId || 0
    @_projectKey = opts.projectKey || ''

    @_host = 'https://api.airbrake.io'

    @_processor = null
    @_reporters = []
    @_filters = []

    if opts.processor != undefined
      @_processor = opts.processor
    else
      @_processor = require('./processors/stack')

    if opts.reporter != undefined
      @addReporter(opts.reporter)
    else
      if 'withCredentials' of new global.XMLHttpRequest()
        reporter = require('./reporters/xhr')
      else
        reporter = require('./reporters/jsonp')
      @addReporter(reporter)

  setProject: (id, key) ->
    @_projectId = id
    @_projectKey = key<commit_msg>Allow host option to be set via constructor function<commit_after>require('./internal/compat')
merge = require('./internal/merge')
Promise = require('./internal/promise')


class Client
  constructor: (opts={}) ->
    @_projectId = opts.projectId || 0
    @_projectKey = opts.projectKey || ''

    @_host = opts.host || 'https://api.airbrake.io'

    @_processor = null
    @_reporters = []
    @_filters = []

    if opts.processor != undefined
      @_processor = opts.processor
    else
      @_processor = require('./processors/stack')

    if opts.reporter != undefined
      @addReporter(opts.reporter)
    else
      if 'withCredentials' of new global.XMLHttpRequest()
        reporter = require('./reporters/xhr')
      else
        reporter = require('./reporters/jsonp')
      @addReporter(reporter)

  setProject: (id, key) ->
    @_projectId = id
    @_projectKey = key
{'fraction_non_alphanumeric': 0.14327485380116958, 'fraction_numerical': 0.0011695906432748538, 'mean_word_length': 2.8710407239819005, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '1308915', 'n_tokens_mistral': 527, 'n_tokens_neox': 512, 'n_words': 110}