<commit_before>module.exports = Hoodie

var Store = require('hoodie-client-store')
var Account = require('hoodie-client-account')
var Task = function () {}
var ConnectionStatus = require('hoodie-client-connection-status')
var Log = require('hoodie-client-log')

var getState = require('./lib/get-state')

function Hoodie (options) {
  var state = getState(options)

  var api = {
    get url () {
      return state.url + '/hoodie'
    }
  }

  var account = new Account({ url: api.url + '/account/api' })

  var CustomStore = Store.defaults({
    remoteBaseUrl: api.url + '/store/api',
    ajax: function () {
      var session = api.account.get('session')
      if (!session) {
        return
      }

      return {
        headers: {
          authorization: 'Bearer ' + session.id
        }
      }
    }
  })
  var dbName = 'user/' + account.id
  var store = new CustomStore(dbName)

  var task = new Task('/hoodie/task/api')

  // core modules<commit_msg>fix: pass options.ajax to Store Constructor, not .defaults<commit_after>module.exports = Hoodie

var Store = require('hoodie-client-store')
var Account = require('hoodie-client-account')
var Task = function () {}
var ConnectionStatus = require('hoodie-client-connection-status')
var Log = require('hoodie-client-log')

var getState = require('./lib/get-state')

function Hoodie (options) {
  var state = getState(options)

  var api = {
    get url () {
      return state.url + '/hoodie'
    }
  }

  var account = new Account({ url: api.url + '/account/api' })

  var CustomStore = Store.defaults({
    remoteBaseUrl: api.url + '/store/api'
  })
  var dbName = 'user/' + account.id
  var store = new CustomStore(dbName, {
    ajax: function () {
      var session = api.account.get('session')
      if (!session) {
        return
      }

      return {
        headers: {
          authorization: 'Bearer ' + session.id
        }
      }
    }
  })

  var task = new Task('/hoodie/task/api')

  // core modules
{'fraction_non_alphanumeric': 0.14278481012658228, 'fraction_numerical': 0.0, 'mean_word_length': 2.6323529411764706, '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': '992633', 'n_tokens_mistral': 630, 'n_tokens_neox': 609, 'n_words': 152}