How to use the js-data.utils.classCallCheck function in js-data

To help you get started, we’ve selected a few js-data examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github js-data / js-data-mongodb / src / index.js View on Github external
export function MongoDBAdapter (opts) {
  utils.classCallCheck(this, MongoDBAdapter)
  opts || (opts = {})
  if (utils.isString(opts)) {
    opts = { uri: opts }
  }
  utils.fillIn(opts, DEFAULTS)

  // Setup non-enumerable properties
  Object.defineProperties(this, {
    /**
     * A Promise that resolves to a reference to the MongoDB client being used by
     * this adapter.
     *
     * @name MongoDBAdapter#client
     * @type {Promise}
     */
    client: {
github js-data / js-data-rethinkdb / src / index.js View on Github external
export function RethinkDBAdapter (opts) {
  utils.classCallCheck(this, RethinkDBAdapter)
  opts || (opts = {})

  // Setup non-enumerable properties
  Object.defineProperties(this, {
    /**
     * The rethinkdbdash instance used by this adapter. Use this directly when
     * you need to write custom queries.
     *
     * @example Use default instance.
     * import { RethinkDBAdapter } from 'js-data-rethinkdb';
     * const adapter = new RethinkDBAdapter();
     * adapter.r.dbDrop('foo').then(...);
     *
     * @example Configure default instance.
     * import { RethinkDBAdapter } from 'js-data-rethinkdb';
     * const adapter = new RethinkDBAdapter({
github js-data / js-data-http / src / index.js View on Github external
export function HttpAdapter (opts) {
  utils.classCallCheck(this, HttpAdapter)

  opts || (opts = {})
  // Fill in any missing options with the defaults
  utils.fillIn(opts, DEFAULTS)
  Adapter.call(this, opts)
}
github GoogleCloudPlatform / js-data-cloud-datastore / src / index.js View on Github external
export function CloudDatastoreAdapter (opts) {
  utils.classCallCheck(this, CloudDatastoreAdapter);
  opts || (opts = {});

  // Setup non-enumerable properties
  Object.defineProperties(this, {
    /**
     * Instance of Datastore used by this adapter. Use this directly when
     * you need to write custom queries.
     *
     * @name CloudDatastoreAdapter#datastore
     * @type {object}
     */
    datastore: {
      writable: true,
      value: undefined
    }
  });
github js-data / js-data-sql / src / index.js View on Github external
export function SqlAdapter (opts) {
  utils.classCallCheck(this, SqlAdapter)
  opts || (opts = {})
  opts.knexOpts || (opts.knexOpts = {})
  utils.fillIn(opts, DEFAULTS)

  Object.defineProperty(this, 'knex', {
    writable: true,
    value: undefined
  })

  Adapter.call(this, opts)

  /**
   * Override the default predicate functions for specified operators.
   *
   * @name SqlAdapter#operators
   * @type {Object}
github js-data / js-data-firebase / src / index.js View on Github external
export function FirebaseAdapter (opts) {
  utils.classCallCheck(this, FirebaseAdapter)
  opts || (opts = {})
  Adapter.call(this, opts)

  /**
   * The database instance used by this adapter.
   *
   * @name FirebaseAdapter#db
   * @type {Object}
   * @default firebase.database()
   */
  if (opts.db) {
    this.db = opts.db || firebase.database()
    /**
     * The base ref to use as a root, e.g. `user/uid`
     *
     * @name FirebaseAdapter#baseRef