<commit_before>'use strict'

var EventLite = require('event-lite')

// Local modules.
var memoryAdapter = require('./adapter/adapters/memory')
var AdapterSingleton = require('./adapter/singleton')
var validate = require('./record_type/validate')
var ensureTypes = require('./record_type/ensure_types')
var dispatch = require('./dispatch')
var middlewares = dispatch.middlewares

// Static re-exports.
var Adapter = require('./adapter')
var common = require('./common')
var assign = common.assign
var methods = common.methods
var events = common.events

// Using this later to check for keys in Object.prototype.
var plainObject = {}


/**
 * This is the default export of the `fortune` package. It implements a
 * [subset of `EventEmitter`](https://www.npmjs.com/package/event-lite), and it
 * has a few static properties attached to it that may be useful to access:
 *
 * - `Adapter`: abstract base class for the Adapter.
 * - `adapters`: included adapters, defaults to memory adapter.
 * - `errors`: custom error types, useful for throwing errors in I/O hooks.
 * - `methods`: a hash that maps to string constants. Available are: `find`,
 *   `create`, `update`, and `delete`.
 * - `events`: names for events on the Fortune instance. Available are:
 *   `change`, `sync`, `connect`, `disconnect`, `failure`.
 * - `message`: a function which accepts the arguments (`id`, `language`,
 *   `data`). It has properties keyed by two-letter language codes, which by
 *   default includes only `en`.
 * - `common`: common dependencies object, containing the above and more.
 */
function Fortune (recordTypes, options) {
  if (!(this instanceof Fortune)) return new Fortune(recordTypes, options)
  this.constructor(recordTypes, options)
}


// Inherit from EventLite class.
Fortune.prototype = Object.create(EventLite.prototype)


/**
 * Create a new instance, the only required input is record type definitions.
 * The first argument must be an object keyed by name, valued by definition<commit_msg>remove incorrect line from docs<commit_after>'use strict'

var EventLite = require('event-lite')

// Local modules.
var memoryAdapter = require('./adapter/adapters/memory')
var AdapterSingleton = require('./adapter/singleton')
var validate = require('./record_type/validate')
var ensureTypes = require('./record_type/ensure_types')
var dispatch = require('./dispatch')
var middlewares = dispatch.middlewares

// Static re-exports.
var Adapter = require('./adapter')
var common = require('./common')
var assign = common.assign
var methods = common.methods
var events = common.events

// Using this later to check for keys in Object.prototype.
var plainObject = {}


/**
 * This is the default export of the `fortune` package. It implements a
 * [subset of `EventEmitter`](https://www.npmjs.com/package/event-lite), and it
 * has a few static properties attached to it that may be useful to access:
 *
 * - `Adapter`: abstract base class for the Adapter.
 * - `adapters`: included adapters, defaults to memory adapter.
 * - `errors`: custom error types, useful for throwing errors in I/O hooks.
 * - `methods`: a hash that maps to string constants. Available are: `find`,
 *   `create`, `update`, and `delete`.
 * - `events`: names for events on the Fortune instance. Available are:
 *   `change`, `sync`, `connect`, `disconnect`, `failure`.
 * - `message`: a function which accepts the arguments (`id`, `language`,
 *   `data`). It has properties keyed by two-letter language codes, which by
 *   default includes only `en`.
 */
function Fortune (recordTypes, options) {
  if (!(this instanceof Fortune)) return new Fortune(recordTypes, options)
  this.constructor(recordTypes, options)
}


// Inherit from EventLite class.
Fortune.prototype = Object.create(EventLite.prototype)


/**
 * Create a new instance, the only required input is record type definitions.
 * The first argument must be an object keyed by name, valued by definition
{'fraction_non_alphanumeric': 0.12188295165394403, 'fraction_numerical': 0.0, 'mean_word_length': 4.276510067114094, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '1008742', 'n_tokens_mistral': 1083, 'n_tokens_neox': 1042, 'n_words': 428}