[
  {
    "__docId__": 0,
    "kind": "file",
    "name": "src/RethinkAdapter.js",
    "content": "// deps\nimport * as nrser from 'nrser';\nconst Promise = nrser.Promise;\nconst _ = nrser._;\nimport { Record, Adapter } from '@nrser/supermodel';\n\n// package\nimport * as util from './util';\n\n// types\nimport t from '@nrser/supermodel/lib/types';\n\nimport type {\n  Integer,\n  PositiveInteger,\n} from 'nrser/lib/types/number';\n\nimport type {\n  Id,\n  Document\n} from '@nrser/supermodel/lib/types';\n\nimport type {\n  IRethinkDb,\n  IConnection,\n  ITable,\n} from './types';\n\n/**\n* Supermodel Adapter for RethinkDB.\n*/\nexport class RethinkAdapter extends Adapter {\n  /**\n  * @param {rethinkdb} [rethinkdb]\n  *   the module returned from require('rethinkdb').\n  *   \n  *   we need to pass it in so that we don't end up using a different \n  *   instantiation than the one that created the connection.\n  * \n  * @param {rethinkdb.Net.Connection} [conn]\n  *   connection to the rethink database.\n  */\n  constructor(rethinkdb, conn) {\n    super();\n    this.r = rethinkdb;\n    this.conn = conn;\n  } // constructor\n  \n  \n  // rethink-specific utils\n  // ========================================================================\n  // \n  \n  \n  /**\n  * get the table name for a Record class; uses the tcomb type name.\n  */\n  tableName(recordClass: Class<Record>): string {\n    return recordClass.meta.name;\n  }\n  \n  \n  /**\n  * get the rethink table for a Record class.\n  */\n  table(recordClass: Class<Record>): RethinkTable {\n    return this.r.table(this.tableName(recordClass));\n  }\n  \n  \n  /**\n  * handle write (insert, replace) response from RethinkDB, which has an \n  * `errors` field with the number of write errors.\n  * \n  * convert it into a Promise rejection if present.\n  */\n  handleWriteResponse(response): Promise<void> {\n    if (response.errors > 0) {\n      return Promise.reject(new Error(response.first_error));\n    }\n    \n    return Promise.resolve();\n  } // .handleWriteResponse\n  \n  \n  /**\n  * ensure the DB is setup for the record classes.\n  * \n  * includes:\n  * \n  * 1.  ensure the database exists.\n  * 2.  for each Record class:\n  *     1.  ensure the table exists.\n  *     2.  ensure the indexes exist.\n  */\n  ensureDBSetup(recordClasses: Array<Class<Record>>): Promise<void> {\n    return (\n      util.ensureDB(this.r, this.conn, this.conn.db)\n        .then(() => this.ensureTables(recordClasses))\n        .then(() => this.ensureIndexes(recordClasses))\n        .then(() => undefined) // return undefined\n    ); // return\n  } // #ensureDBSetup\n  \n  \n  /**\n  * ensure tables for the Record classes have been created.\n  * \n  * returns a Promise of an object with table names mapped to whether the\n  * table had to be created or not.\n  */\n  ensureTables(\n    recordClasses: Array<Class<Record>>,\n  ): Promise<{[tableName: string]: boolean}> {    \n    return (\n      Promise.props(\n        _.chain(recordClasses)\n          .map((recordClass) => {\n            const tableName = this.tableName(recordClass);\n            \n            debug: `ensuring table ${ tableName }...`;\n            \n            return [\n              tableName,\n              util.ensureTable(this.r, this.conn, tableName),\n            ];\n          })\n          .fromPairs()\n          .value()\n      ) // Promise.props\n    ); // return\n  } // ensureTable\n  \n  \n  /**\n  * ensure all the indexes declared in the Record class exist, creating if\n  * necessary. if `wait` is true, uses `rethinkdb.indexWait` to wait for the\n  * index to be ready.\n  * \n  * returns a `Promise<void>` that resolves when all done, or rejects on error.\n  */\n  ensureIndexes(\n    recordClasses: Class<Record> | Array<Class<Record>>,\n    {\n      wait = true,\n    } : {\n      wait: boolean,\n    } = {}\n  ): Promise<\n    {[recordName: string]: {[indexName: string]: boolean}} |\n    {[indexName: string]: boolean}\n  > {\n    debug: \"ensuring indexes...\";\n    \n    // if we were passed and array of Record classes, return a promise that\n    // maps their meta names to the results of ensuring the indexes on\n    // each one.\n    if (Array.isArray(recordClasses)) {\n      return (\n        Promise.props(\n          _.chain(recordClasses)\n            .map((recordClass) => {\n              return [\n                recordClass.meta.name,\n                this.ensureIndexes(recordClass, {wait})\n              ];\n            })\n            .fromPairs()\n            .value() // end chain\n        ) // Promise.props\n      ); // return\n    } // if isArray\n    \n    // now it should be a single record class\n    const recordClass: Class<Record> = recordClasses;\n    const tableName: string = this.tableName(recordClass);\n    \n    debug: `ensuring indexes for ${ recordClass.meta.name }`;\n    \n    // return a promise mapping index names to whether they were\n    // created or not\n    return (\n      Promise.props(\n        // take the index meta data\n        _.chain(recordClass.meta.indexes)\n          // pick the ones with truth-y values\n          .pickBy(\n            (shouldIndex: boolean, indexName: string) => !!shouldIndex\n          )\n          // get the keys, which are the index names\n          .keys()\n          // and map each to the ensureIndex promise\n          .map((indexName: string): [string, Promise<boolean>] => {\n            let promise = util.ensureIndex(\n              this.r,\n              this.conn,\n              tableName,\n              indexName\n            );\n            \n            return [indexName, promise];\n          })\n          .fromPairs()\n          .value()\n      ) // Promise.props\n      .tap((created: {[indexName: string]: boolean}) => {\n        debug: \"indexes ENSURED\", created;\n        \n        if (wait) {\n          debug: `waiting for indexes on ${ tableName }...`;\n          \n          return this.table(recordClass).indexWait().run(this.conn)\n            .then(() => {\n              debug: `indexes ready on ${ tableName }.`;\n            });\n        }\n      })\n    ); // return  \n  } // #ensureIndexes\n  \n  \n  // Adapter API implementations\n  // =========================================================================\n  // \n  \n  \n  /**\n  * @private\n  * @override\n  */\n  _get(\n    recordClass: Class<Record>,\n    id: Id,\n    options: Object,\n  ): Promise<Document> {\n    let query = this.table(recordClass).get(id);\n    \n    if (options.join) {\n      query = query.merge(function(instance) {\n        return _.mapValues(options.join, ({recordClass, idProp}) => {\n          return this.table(recordClass).get(instance(idProp));\n        })\n      })\n    }\n      \n    return query.run(this.conn);\n  }\n  \n  \n  /**\n  * @private\n  * @override\n  */\n  _need(\n    recordClass: Class<Record>,\n    id: Id,\n    options: Object,\n  ): Promise<Document> {\n    return this.get(recordClass, id, options)\n      .then((doc: ?Document) => {\n        if (doc === null) {\n          throw new nrser.NotFoundError(\n            `no ${ recordClass.name } found with id ${ id }`\n          );\n        }\n        \n        return doc;\n      });\n  } // #_need\n  \n  \n  /**\n  * @private\n  * @override\n  * \n  * @param {Object} options\n  * @param {boolean} options.compact\n  *   if true, the results should have keys with null values omitted.\n  */\n  _getByIds(\n    recordClass: Class<Record>,\n    ids: Array<Id>,\n    options: Object,\n  ): Promise<{[id: Id]: ?Record}> {\n    const compacted = this\n      .table(recordClass)\n      .getAll(...ids)\n      .run(this.conn)\n      .then((cursor) => cursor.toArray())\n      .then((docs) => {\n        return _.keyBy(docs, 'id');\n      });\n    \n    if (options.compact) {\n      return compacted;\n    }\n    \n    return compacted.then((byIds) => {\n      _.each(ids, (id) => {\n        if (!_.has(byIds, id)) {\n          byIds[id] = null;\n        }\n      });\n      \n      return byIds;\n    });\n  } // #_getByIds\n  \n  \n  /**\n  * @private\n  * @override\n  */\n  _needByIds(\n    recordClass: Class<Record>,\n    ids: Array<Id>,\n    options: Object = {},\n  ): Promise<{[id: Id]: Record}> {\n    return this\n      // call _getByIds with compact=true so that it doesn't add null entries\n      ._getByIds(recordClass, ids, {compact: true})\n      // then check if we got all of them\n      .then((byIds) => {\n        if (_.size(byIds) !== ids.length) {\n          // something's missing, throw up\n          const missingIds = _.difference(ids, _.keys(byIds));\n          \n          throw nrser.NotFoundError.squish(`\n            could not find ${ recordClass.meta.name } with ids \n            ${ missingIds }\n          `);\n        }\n        \n        return byIds;\n      });\n  } // #_needByIds\n  \n  \n  /**\n  * @private\n  * @override\n  */\n  _all(\n    recordClass: Class<Record>,\n    options: Object\n  ): Promise<{[id: Id]: Document}> {\n    return this\n      .table(recordClass)\n      .run(this.conn)\n      .then((cursor) => {\n        return cursor.toArray();\n      })\n      .then((docs) => {\n        return _.keyBy(docs, 'id');\n      });\n  }\n  \n  \n  /**\n  * internal implementation of {#slice} called after arguments have been\n  * validated and normalized.\n  */\n  _slice(\n    recordClass: Class<Record>,\n    {\n      start,\n      end,\n    }: {\n      start: Integer,\n      end?: Integer,\n    }\n  ): Promise<Array<Document>> {\n    // supermodel.Adapter#slice takes care of argument validation and\n    // short-circuiting empty slices. when we get here we know:\n    // \n    // -  end and limit are not both defined\n    // -  if end is defined\n    //    -   it is an integer greater than start\n    //    -   end - start > 0\n    // \n    \n    if (start < 0) {\n      // we're starting the slice at the end of the array, which rethink\n      // doesn't natively support, so we need to convert it into a slice from\n      // the beginning on a reverse-ordered cursor, then reverse the results.\n      \n      // the reserve end is just the negation of the (negative) start (making\n      // it positive)\n      const reverseEnd = -1 * start;\n      \n      // the reverse end is either 0 if no end was provided, or the negation\n      const reserveStart = t.Nil.is(end) ? 0 : -1 * end;\n      \n      return this.table(recordClass)\n        .orderBy({index: this.r.desc('createdAt')})\n        .slice(reserveStart, reverseEnd)\n        .run(this.conn)\n        .then(cursor => cursor.toArray())\n        .then(docs => docs.reverse());\n    }\n    \n    return this.table(recordClass)\n      .orderBy({index: this.r.asc('createdAt')})\n      .slice(start, end)\n      .run(this.conn)\n      .then((cursor) => {\n        return cursor.toArray();\n      });\n  } // #_slice\n  \n  \n  /**\n  * @private\n  * @override\n  * \n  * @param {Object} options\n  *   for future use.\n  */\n  _sample(\n    recordClass: Class<Record>,\n    number: PositiveInteger,\n    options: Object,\n  ): Promise<Array<Document>> {\n    return this\n      .table(recordClass)\n      .sample(number)\n      .run(this.conn);\n  } // #_sample\n  \n  \n  /**\n  * insert a Record into the database.\n  * \n  * returns a new Record instance that reflects the changes (setting \n  * `updatedAt`).\n  */\n  insert(\n    record: Record,\n  ): Promise<Record> {\n    const data = record.makeObjectForWrite();\n    \n    return this.r\n      .table(this.tableName(record.constructor))\n      .insert(data)\n      .run(this.conn)\n      .then(this.handleWriteResponse.bind(this))\n      .then(() => new record.constructor(data));\n  } // #insert\n  \n  \n  /**\n  * replace a Record in the database.\n  * \n  * returns a new Record instance that reflects the changes (setting \n  * `updatedAt`).\n  */\n  replace(\n    record: Record,\n  ): Promise<Record> {\n    const data = record.makeObjectForWrite();\n    \n    return this.r\n      .table(this.tableName(record.constructor))\n      .get(record.id)\n      .replace(data)\n      .run(this.conn)\n      .then(this.handleWriteResponse.bind(this))\n      .then(() => new record.constructor(data));\n  } // #replace\n  \n  /**\n  * internal driver-specific implementation of {#update} called after\n  * arguments have been validated and normalized.\n  * \n  * the updated Record instance is kept in {#update} and resolved from there;\n  * this method only need to resolve `void` on success or reject with an\n  * Error on failure.\n  */\n  _update(\n    record: Record,\n    props: Object,\n    {\n      check = true,\n    } : {\n      check?: boolean,\n    } = {},\n  ): Promise<void> {\n    let query = this.r\n      .table(this.tableName(record.constructor))\n      .get(record.id);\n    \n    if (check) {\n      // we need to check that the rev hasn't changed from the version\n      // we are updating\n      query = query.update((data) => {\n        return this.r.branch(\n          data('rev').eq(record.rev),\n          props,\n          this.r.error(\"rev in database does not match record rev.\")\n        );\n      });\n      \n    } else {\n      // we don't care what rev is in the db, just blast it\n      query = query.update(props);\n    }\n    \n    return query.run(this.conn)\n      .then(this.handleWriteResponse.bind(this));\n  } // #_update\n  \n  \n  // adaptations\n  // ===========\n  \n} // RethinkAdapter",
    "static": true,
    "longname": "src/RethinkAdapter.js",
    "access": null,
    "description": null,
    "lineNumber": 1
  },
  {
    "__docId__": 1,
    "kind": "variable",
    "name": "Promise",
    "memberof": "src/RethinkAdapter.js",
    "static": true,
    "longname": "src/RethinkAdapter.js~Promise",
    "access": null,
    "export": false,
    "importPath": "@nrser/supermodel-rethinkdb/src/RethinkAdapter.js",
    "importStyle": null,
    "description": null,
    "lineNumber": 3,
    "undocument": true,
    "unknown": [
      {
        "tagName": "@_undocument",
        "tagValue": ""
      }
    ],
    "type": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 2,
    "kind": "variable",
    "name": "_",
    "memberof": "src/RethinkAdapter.js",
    "static": true,
    "longname": "src/RethinkAdapter.js~_",
    "access": null,
    "export": false,
    "importPath": "@nrser/supermodel-rethinkdb/src/RethinkAdapter.js",
    "importStyle": null,
    "description": null,
    "lineNumber": 4,
    "undocument": true,
    "unknown": [
      {
        "tagName": "@_undocument",
        "tagValue": ""
      }
    ],
    "type": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 3,
    "kind": "class",
    "name": "RethinkAdapter",
    "memberof": "src/RethinkAdapter.js",
    "static": true,
    "longname": "src/RethinkAdapter.js~RethinkAdapter",
    "access": null,
    "export": true,
    "importPath": "@nrser/supermodel-rethinkdb/src/RethinkAdapter.js",
    "importStyle": "{RethinkAdapter}",
    "description": "Supermodel Adapter for RethinkDB.",
    "lineNumber": 32,
    "interface": false,
    "extends": [
      "@nrser/supermodel~Adapter"
    ]
  },
  {
    "__docId__": 4,
    "kind": "constructor",
    "name": "constructor",
    "memberof": "src/RethinkAdapter.js~RethinkAdapter",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/RethinkAdapter.js~RethinkAdapter#constructor",
    "access": null,
    "description": "",
    "lineNumber": 43,
    "params": [
      {
        "nullable": null,
        "types": [
          "rethinkdb"
        ],
        "spread": false,
        "optional": true,
        "name": "rethinkdb",
        "description": "the module returned from require('rethinkdb').\n  \n  we need to pass it in so that we don't end up using a different \n  instantiation than the one that created the connection."
      },
      {
        "nullable": null,
        "types": [
          "rethinkdb.Net.Connection"
        ],
        "spread": false,
        "optional": true,
        "name": "conn",
        "description": "connection to the rethink database."
      }
    ]
  },
  {
    "__docId__": 5,
    "kind": "member",
    "name": "r",
    "memberof": "src/RethinkAdapter.js~RethinkAdapter",
    "static": false,
    "longname": "src/RethinkAdapter.js~RethinkAdapter#r",
    "access": null,
    "description": null,
    "lineNumber": 45,
    "undocument": true,
    "unknown": [
      {
        "tagName": "@_undocument",
        "tagValue": ""
      }
    ],
    "type": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 6,
    "kind": "member",
    "name": "conn",
    "memberof": "src/RethinkAdapter.js~RethinkAdapter",
    "static": false,
    "longname": "src/RethinkAdapter.js~RethinkAdapter#conn",
    "access": null,
    "description": null,
    "lineNumber": 46,
    "undocument": true,
    "unknown": [
      {
        "tagName": "@_undocument",
        "tagValue": ""
      }
    ],
    "type": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 7,
    "kind": "method",
    "name": "tableName",
    "memberof": "src/RethinkAdapter.js~RethinkAdapter",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/RethinkAdapter.js~RethinkAdapter#tableName",
    "access": null,
    "description": "get the table name for a Record class; uses the tcomb type name.",
    "lineNumber": 58,
    "params": [
      {
        "name": "recordClass",
        "types": [
          "*"
        ]
      }
    ],
    "return": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 8,
    "kind": "method",
    "name": "table",
    "memberof": "src/RethinkAdapter.js~RethinkAdapter",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/RethinkAdapter.js~RethinkAdapter#table",
    "access": null,
    "description": "get the rethink table for a Record class.",
    "lineNumber": 66,
    "params": [
      {
        "name": "recordClass",
        "types": [
          "*"
        ]
      }
    ],
    "return": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 9,
    "kind": "method",
    "name": "handleWriteResponse",
    "memberof": "src/RethinkAdapter.js~RethinkAdapter",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/RethinkAdapter.js~RethinkAdapter#handleWriteResponse",
    "access": null,
    "description": "handle write (insert, replace) response from RethinkDB, which has an \n`errors` field with the number of write errors.\n\nconvert it into a Promise rejection if present.",
    "lineNumber": 77,
    "params": [
      {
        "name": "response",
        "types": [
          "*"
        ]
      }
    ],
    "return": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 10,
    "kind": "method",
    "name": "ensureDBSetup",
    "memberof": "src/RethinkAdapter.js~RethinkAdapter",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/RethinkAdapter.js~RethinkAdapter#ensureDBSetup",
    "access": null,
    "description": "ensure the DB is setup for the record classes.\n\nincludes:\n\n1.  ensure the database exists.\n2.  for each Record class:\n    1.  ensure the table exists.\n    2.  ensure the indexes exist.",
    "lineNumber": 96,
    "params": [
      {
        "name": "recordClasses",
        "types": [
          "*"
        ]
      }
    ],
    "return": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 11,
    "kind": "method",
    "name": "ensureTables",
    "memberof": "src/RethinkAdapter.js~RethinkAdapter",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/RethinkAdapter.js~RethinkAdapter#ensureTables",
    "access": null,
    "description": "ensure tables for the Record classes have been created.\n\nreturns a Promise of an object with table names mapped to whether the\ntable had to be created or not.",
    "lineNumber": 112,
    "params": [
      {
        "name": "recordClasses",
        "types": [
          "*"
        ]
      }
    ],
    "return": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 12,
    "kind": "method",
    "name": "ensureIndexes",
    "memberof": "src/RethinkAdapter.js~RethinkAdapter",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/RethinkAdapter.js~RethinkAdapter#ensureIndexes",
    "access": null,
    "description": "ensure all the indexes declared in the Record class exist, creating if\nnecessary. if `wait` is true, uses `rethinkdb.indexWait` to wait for the\nindex to be ready.\n\nreturns a `Promise<void>` that resolves when all done, or rejects on error.",
    "lineNumber": 142,
    "params": [
      {
        "name": "recordClasses",
        "types": [
          "*"
        ]
      },
      {
        "name": "objectPattern1",
        "optional": true,
        "types": [
          "{\"wait\": *}"
        ],
        "defaultRaw": {},
        "defaultValue": "{}"
      }
    ],
    "return": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 13,
    "kind": "method",
    "name": "_get",
    "memberof": "src/RethinkAdapter.js~RethinkAdapter",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/RethinkAdapter.js~RethinkAdapter#_get",
    "access": "private",
    "description": "",
    "lineNumber": 231,
    "params": [
      {
        "name": "recordClass",
        "types": [
          "*"
        ]
      },
      {
        "name": "id",
        "types": [
          "*"
        ]
      },
      {
        "name": "options",
        "types": [
          "*"
        ]
      }
    ],
    "return": {
      "types": [
        "*"
      ]
    },
    "override": true
  },
  {
    "__docId__": 14,
    "kind": "method",
    "name": "_need",
    "memberof": "src/RethinkAdapter.js~RethinkAdapter",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/RethinkAdapter.js~RethinkAdapter#_need",
    "access": "private",
    "description": "",
    "lineNumber": 254,
    "params": [
      {
        "name": "recordClass",
        "types": [
          "*"
        ]
      },
      {
        "name": "id",
        "types": [
          "*"
        ]
      },
      {
        "name": "options",
        "types": [
          "*"
        ]
      }
    ],
    "return": {
      "types": [
        "*"
      ]
    },
    "override": true
  },
  {
    "__docId__": 15,
    "kind": "method",
    "name": "_getByIds",
    "memberof": "src/RethinkAdapter.js~RethinkAdapter",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/RethinkAdapter.js~RethinkAdapter#_getByIds",
    "access": "private",
    "description": "",
    "lineNumber": 280,
    "params": [
      {
        "nullable": null,
        "types": [
          "Object"
        ],
        "spread": false,
        "optional": false,
        "name": "options",
        "description": ""
      },
      {
        "nullable": null,
        "types": [
          "boolean"
        ],
        "spread": false,
        "optional": false,
        "name": "options.compact",
        "description": "if true, the results should have keys with null values omitted."
      }
    ],
    "return": {
      "types": [
        "*"
      ]
    },
    "override": true
  },
  {
    "__docId__": 16,
    "kind": "method",
    "name": "_needByIds",
    "memberof": "src/RethinkAdapter.js~RethinkAdapter",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/RethinkAdapter.js~RethinkAdapter#_needByIds",
    "access": "private",
    "description": "",
    "lineNumber": 314,
    "params": [
      {
        "name": "recordClass",
        "types": [
          "*"
        ]
      },
      {
        "name": "ids",
        "types": [
          "*"
        ]
      },
      {
        "name": "options",
        "optional": true,
        "types": [
          "{}"
        ],
        "defaultRaw": {},
        "defaultValue": "{}"
      }
    ],
    "return": {
      "types": [
        "*"
      ]
    },
    "override": true
  },
  {
    "__docId__": 17,
    "kind": "method",
    "name": "_all",
    "memberof": "src/RethinkAdapter.js~RethinkAdapter",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/RethinkAdapter.js~RethinkAdapter#_all",
    "access": "private",
    "description": "",
    "lineNumber": 343,
    "params": [
      {
        "name": "recordClass",
        "types": [
          "*"
        ]
      },
      {
        "name": "options",
        "types": [
          "*"
        ]
      }
    ],
    "return": {
      "types": [
        "*"
      ]
    },
    "override": true
  },
  {
    "__docId__": 18,
    "kind": "method",
    "name": "_slice",
    "memberof": "src/RethinkAdapter.js~RethinkAdapter",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/RethinkAdapter.js~RethinkAdapter#_slice",
    "access": null,
    "description": "internal implementation of {#slice} called after arguments have been\nvalidated and normalized.",
    "lineNumber": 363,
    "params": [
      {
        "name": "recordClass",
        "types": [
          "*"
        ]
      },
      {
        "name": "objectPattern1",
        "types": [
          "{\"start\": *, \"end\": *}"
        ],
        "defaultRaw": {
          "start": null,
          "end": null
        },
        "defaultValue": "{\"start\":null,\"end\":null}"
      }
    ],
    "return": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 19,
    "kind": "method",
    "name": "_sample",
    "memberof": "src/RethinkAdapter.js~RethinkAdapter",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/RethinkAdapter.js~RethinkAdapter#_sample",
    "access": "private",
    "description": "",
    "lineNumber": 419,
    "params": [
      {
        "nullable": null,
        "types": [
          "Object"
        ],
        "spread": false,
        "optional": false,
        "name": "options",
        "description": "for future use."
      }
    ],
    "return": {
      "types": [
        "*"
      ]
    },
    "override": true
  },
  {
    "__docId__": 20,
    "kind": "method",
    "name": "insert",
    "memberof": "src/RethinkAdapter.js~RethinkAdapter",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/RethinkAdapter.js~RethinkAdapter#insert",
    "access": null,
    "description": "insert a Record into the database.\n\nreturns a new Record instance that reflects the changes (setting \n`updatedAt`).",
    "lineNumber": 437,
    "params": [
      {
        "name": "record",
        "types": [
          "*"
        ]
      }
    ],
    "return": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 21,
    "kind": "method",
    "name": "replace",
    "memberof": "src/RethinkAdapter.js~RethinkAdapter",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/RethinkAdapter.js~RethinkAdapter#replace",
    "access": null,
    "description": "replace a Record in the database.\n\nreturns a new Record instance that reflects the changes (setting \n`updatedAt`).",
    "lineNumber": 457,
    "params": [
      {
        "name": "record",
        "types": [
          "*"
        ]
      }
    ],
    "return": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 22,
    "kind": "method",
    "name": "_update",
    "memberof": "src/RethinkAdapter.js~RethinkAdapter",
    "generator": false,
    "async": false,
    "static": false,
    "longname": "src/RethinkAdapter.js~RethinkAdapter#_update",
    "access": null,
    "description": "internal driver-specific implementation of {#update} called after\narguments have been validated and normalized.\n\nthe updated Record instance is kept in {#update} and resolved from there;\nthis method only need to resolve `void` on success or reject with an\nError on failure.",
    "lineNumber": 479,
    "params": [
      {
        "name": "record",
        "types": [
          "*"
        ]
      },
      {
        "name": "props",
        "types": [
          "*"
        ]
      },
      {
        "name": "objectPattern2",
        "optional": true,
        "types": [
          "{\"check\": *}"
        ],
        "defaultRaw": {},
        "defaultValue": "{}"
      }
    ],
    "return": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 23,
    "kind": "file",
    "name": "src/index.js",
    "content": "export * as util from './util';\nexport * from './RethinkAdapter';\n",
    "static": true,
    "longname": "src/index.js",
    "access": null,
    "description": null,
    "lineNumber": 1
  },
  {
    "__docId__": 24,
    "kind": "file",
    "name": "src/types.js",
    "content": "\n/**\n* interface for the rethinkdb module.\n*/\nexport type IRethinkDB = Object;\n\n/**\n* interface for a rethinkdb.net.Connection instance.\n*/\nexport type IConnection = Object;\n\n/**\n* what's returned by r.table(<string>)\n*/\nexport type ITable = Object;",
    "static": true,
    "longname": "src/types.js",
    "access": null,
    "description": null,
    "lineNumber": 1
  },
  {
    "__docId__": 25,
    "kind": "file",
    "name": "src/util.js",
    "content": "/**\n* utilities, many of which operate against rethinkdb independent of \n* Supermodel constructs.\n*/\n\n// @flow\n\nimport uuid from 'uuid';\nimport * as nrser from 'nrser';\nconst _ = nrser._;\nconst Promise = nrser.Promise;\n\n// types\nimport type {\n  IRethinkDB,\n  IConnection,\n} from './types';\n\n/**\n* attempt to connect to the database, re-scheduling an attempt with a back-off\n* timeout if it fails.\n* \n* wraps this all up in a Promise that resolved when the connection succeeds\n* or rejects when it runs out of attempts.\n*/\nfunction attemptToConnect(\n  r: IRethinkDb,\n  {\n    resolve,\n    reject,\n    host,\n    port,\n    db,\n    attemptNumber,\n    maxAttempts,\n    baseTimeout,\n    maxTimeout,\n  }: {\n    resolve: Function,\n    reject: Function,\n    host: string,\n    port: number,\n    db: string,\n    attemptNumber: number,\n    maxAttempts: number,\n    baseTimeout: number,\n    maxTimeout: number,\n  }\n): Promise<IConnection> {\n  info: `attempt ${ attemptNumber } to connect to db`;\n  \n  r.connect(\n    {host, db, port},\n    (error: ?Error, conn: ?IConnection): void => {\n      if (error) {\n        error: `failed to connect to db on attempt ${ attemptNumber }`,\n          {error};\n        \n        if (maxAttempts > 0 && attemptNumber >= maxAttempts) {\n          error: \"out of attempts, rejecting.\"\n          \n          reject(error);\n        } else {\n          const timeout = Math.min(timeout * attemptNumber, maxTimeout);\n          \n          info: `scheduling connection attempt in ${ timeout }ms`;\n          \n          setTimeout(\n            () => {\n              attemptToConnect({\n                resolve,\n                reject,\n                attemptNumber: attemptNumber + 1,\n                maxAttempts,\n                timeout,\n              })\n            },\n            timeout,\n          );\n        }\n      } else {\n        info: `db connected on attempt ${ attemptNumber }`;\n        resolve(conn);\n      }\n    }\n  );\n} // .attemptToConnect\n\n/**\n* connect to the db, using `.attemptToConnect` internally.\n*\n* by default will continue to try connecting every `timeout` milliseconds\n* (default 1000ms = 1s).\n*/\nexport function connect(\n  r: IRethinkDb,\n  {\n    host,\n    port = 28015,\n    db,\n    maxAttempts = 0,\n    baseTimeout = 1000,\n    maxTimeout = 5000,\n  }: {\n    host: string,\n    port?: number,\n    db?: string,\n    maxAttempts?: number,\n    baseTimeout?: number,\n    maxTimeout?: number,\n  } = {}\n): Promise<IConnection> {\n  return new Promise((resolve, reject) => {\n    attemptToConnect(r, {\n      resolve,\n      reject,\n      host,\n      port,\n      db,\n      attemptNumber: 1,\n      maxAttempts,\n      baseTimeout,\n      maxTimeout,\n    });\n  });\n} // .connect\n\n/**\n* makes sure a db exists by attempting to create it and suppressing the\n* error if it already exists.\n* \n* @return [Promise<boolean>] true if the db was created.\n*/\nexport function ensureDB(\n  r: IRethinkDB,\n  conn: IConnection,\n  dbName: string,\n): Promise<boolean> {\n  debug: `ensuring db ${ dbName }...`;\n  \n  return r.dbCreate(dbName).run(conn)\n    .then(() => {\n      debug: `db ${ dbName } created.`;\n      return true;\n    })\n    .catch((error: Error) => {\n      if (error.message.match(/Database\\ .*\\ already\\ exists/)) {\n        debug: `db ${ dbName } already present.`;\n        return false;\n      }\n      throw error;\n    });\n} // .ensureDB\n\n/**\n* makes sure a table exists by attempting to create it and suppressing the\n* error if it already exists.\n* \n* @return [Promise<boolean>] true if the table was created.\n*/\nexport function ensureTable(\n  r: RethinkDB,\n  conn: IConnection,\n  tableName: string,\n): Promise<boolean> {\n  return r.tableCreate(tableName).run(conn)\n    .then(() => true)\n    .catch((error: Error) => {\n      if (error.message.match(/Table\\ .*\\ already\\ exists/)) {\n        return false;\n      }\n      throw error;\n    });\n} // .ensureTable\n\n/**\n* ensure that an index exists on a table, creating if necessary.\n* \n* returns `Promise<boolean>` that resolved `true` if the index was created\n* and `false` if it was already there.\n*/\nexport function ensureIndex(\n  r: IRethinkDB,\n  conn: IConnection,\n  tableName: string,\n  indexName: string,\n  ...indexCreateOptions: Array<*>\n): Promise<boolean> {\n  debug: `ENSURING index ${ indexName } on table ${ tableName }`, {\n    indexCreateOptions\n  };\n  \n  return r\n    .table(tableName)\n    .indexCreate(indexName, ...indexCreateOptions)\n    .run(conn)\n    .then((): boolean => {\n      debug: `ensuring index ${ indexName } CREATED on table ${ tableName }`;\n      return true;\n    })\n    .catch((error: Error) => {\n      if (error.message.match(/Index\\ .*\\ already\\ exists/)) {\n        debug: `ensuring index ${ indexName } EXISTED on table ${ tableName }`;\n        return false;\n      }\n      throw error;\n    });\n} // .ensureIndex\n\n",
    "static": true,
    "longname": "src/util.js",
    "access": null,
    "description": null,
    "lineNumber": 1
  },
  {
    "__docId__": 26,
    "kind": "variable",
    "name": "_",
    "memberof": "src/util.js",
    "static": true,
    "longname": "src/util.js~_",
    "access": null,
    "export": false,
    "importPath": "@nrser/supermodel-rethinkdb/src/util.js",
    "importStyle": null,
    "description": null,
    "lineNumber": 10,
    "undocument": true,
    "unknown": [
      {
        "tagName": "@_undocument",
        "tagValue": ""
      }
    ],
    "type": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 27,
    "kind": "variable",
    "name": "Promise",
    "memberof": "src/util.js",
    "static": true,
    "longname": "src/util.js~Promise",
    "access": null,
    "export": false,
    "importPath": "@nrser/supermodel-rethinkdb/src/util.js",
    "importStyle": null,
    "description": null,
    "lineNumber": 11,
    "undocument": true,
    "unknown": [
      {
        "tagName": "@_undocument",
        "tagValue": ""
      }
    ],
    "type": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 28,
    "kind": "function",
    "name": "attemptToConnect",
    "memberof": "src/util.js",
    "generator": false,
    "async": false,
    "static": true,
    "longname": "src/util.js~attemptToConnect",
    "access": null,
    "export": false,
    "importPath": "@nrser/supermodel-rethinkdb/src/util.js",
    "importStyle": null,
    "description": "attempt to connect to the database, re-scheduling an attempt with a back-off\ntimeout if it fails.\n\nwraps this all up in a Promise that resolved when the connection succeeds\nor rejects when it runs out of attempts.",
    "lineNumber": 26,
    "params": [
      {
        "name": "r",
        "types": [
          "*"
        ]
      },
      {
        "name": "objectPattern1",
        "types": [
          "{\"resolve\": *, \"reject\": *, \"host\": *, \"port\": *, \"db\": *, \"attemptNumber\": *, \"maxAttempts\": *, \"baseTimeout\": *, \"maxTimeout\": *}"
        ],
        "defaultRaw": {
          "resolve": null,
          "reject": null,
          "host": null,
          "port": null,
          "db": null,
          "attemptNumber": null,
          "maxAttempts": null,
          "baseTimeout": null,
          "maxTimeout": null
        },
        "defaultValue": "{\"resolve\":null,\"reject\":null,\"host\":null,\"port\":null,\"db\":null,\"attemptNumber\":null,\"maxAttempts\":null,\"baseTimeout\":null,\"maxTimeout\":null}"
      }
    ]
  },
  {
    "__docId__": 29,
    "kind": "function",
    "name": "connect",
    "memberof": "src/util.js",
    "generator": false,
    "async": false,
    "static": true,
    "longname": "src/util.js~connect",
    "access": null,
    "export": true,
    "importPath": "@nrser/supermodel-rethinkdb/src/util.js",
    "importStyle": "{connect}",
    "description": "connect to the db, using `.attemptToConnect` internally.\n\nby default will continue to try connecting every `timeout` milliseconds\n(default 1000ms = 1s).",
    "lineNumber": 95,
    "params": [
      {
        "name": "r",
        "types": [
          "*"
        ]
      },
      {
        "name": "objectPattern1",
        "optional": true,
        "types": [
          "{\"host\": *, \"port\": *, \"db\": *, \"maxAttempts\": *, \"baseTimeout\": *, \"maxTimeout\": *}"
        ],
        "defaultRaw": {},
        "defaultValue": "{}"
      }
    ],
    "return": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 30,
    "kind": "function",
    "name": "ensureDB",
    "memberof": "src/util.js",
    "generator": false,
    "async": false,
    "static": true,
    "longname": "src/util.js~ensureDB",
    "access": null,
    "export": true,
    "importPath": "@nrser/supermodel-rethinkdb/src/util.js",
    "importStyle": "{ensureDB}",
    "description": "makes sure a db exists by attempting to create it and suppressing the\nerror if it already exists.",
    "lineNumber": 134,
    "params": [
      {
        "name": "r",
        "types": [
          "*"
        ]
      },
      {
        "name": "conn",
        "types": [
          "*"
        ]
      },
      {
        "name": "dbName",
        "types": [
          "*"
        ]
      }
    ],
    "return": {
      "nullable": null,
      "types": [
        "*"
      ],
      "spread": false,
      "description": "[Promise<boolean>] true if the db was created."
    }
  },
  {
    "__docId__": 31,
    "kind": "function",
    "name": "ensureTable",
    "memberof": "src/util.js",
    "generator": false,
    "async": false,
    "static": true,
    "longname": "src/util.js~ensureTable",
    "access": null,
    "export": true,
    "importPath": "@nrser/supermodel-rethinkdb/src/util.js",
    "importStyle": "{ensureTable}",
    "description": "makes sure a table exists by attempting to create it and suppressing the\nerror if it already exists.",
    "lineNumber": 161,
    "params": [
      {
        "name": "r",
        "types": [
          "*"
        ]
      },
      {
        "name": "conn",
        "types": [
          "*"
        ]
      },
      {
        "name": "tableName",
        "types": [
          "*"
        ]
      }
    ],
    "return": {
      "nullable": null,
      "types": [
        "*"
      ],
      "spread": false,
      "description": "[Promise<boolean>] true if the table was created."
    }
  },
  {
    "__docId__": 32,
    "kind": "function",
    "name": "ensureIndex",
    "memberof": "src/util.js",
    "generator": false,
    "async": false,
    "static": true,
    "longname": "src/util.js~ensureIndex",
    "access": null,
    "export": true,
    "importPath": "@nrser/supermodel-rethinkdb/src/util.js",
    "importStyle": "{ensureIndex}",
    "description": "ensure that an index exists on a table, creating if necessary.\n\nreturns `Promise<boolean>` that resolved `true` if the index was created\nand `false` if it was already there.",
    "lineNumber": 182,
    "params": [
      {
        "name": "r",
        "types": [
          "*"
        ]
      },
      {
        "name": "conn",
        "types": [
          "*"
        ]
      },
      {
        "name": "tableName",
        "types": [
          "*"
        ]
      },
      {
        "name": "indexName",
        "types": [
          "*"
        ]
      },
      {
        "name": "indexCreateOptions",
        "types": [
          "...*"
        ],
        "spread": true
      }
    ],
    "return": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 34,
    "kind": "external",
    "name": "Infinity",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Infinity",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 35,
    "kind": "external",
    "name": "NaN",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~NaN",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 36,
    "kind": "external",
    "name": "undefined",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~undefined",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 37,
    "kind": "external",
    "name": "null",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~null",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 38,
    "kind": "external",
    "name": "Object",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Object",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 39,
    "kind": "external",
    "name": "object",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~object",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 40,
    "kind": "external",
    "name": "Function",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Function",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 41,
    "kind": "external",
    "name": "function",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~function",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 42,
    "kind": "external",
    "name": "Boolean",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Boolean",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 43,
    "kind": "external",
    "name": "boolean",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~boolean",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 44,
    "kind": "external",
    "name": "Symbol",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Symbol",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 45,
    "kind": "external",
    "name": "Error",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Error",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 46,
    "kind": "external",
    "name": "EvalError",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~EvalError",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 47,
    "kind": "external",
    "name": "InternalError",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/InternalError",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~InternalError",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 48,
    "kind": "external",
    "name": "RangeError",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~RangeError",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 49,
    "kind": "external",
    "name": "ReferenceError",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~ReferenceError",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 50,
    "kind": "external",
    "name": "SyntaxError",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~SyntaxError",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 51,
    "kind": "external",
    "name": "TypeError",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~TypeError",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 52,
    "kind": "external",
    "name": "URIError",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~URIError",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 53,
    "kind": "external",
    "name": "Number",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Number",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 54,
    "kind": "external",
    "name": "number",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~number",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 55,
    "kind": "external",
    "name": "Date",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Date",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 56,
    "kind": "external",
    "name": "String",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~String",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 57,
    "kind": "external",
    "name": "string",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~string",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 58,
    "kind": "external",
    "name": "RegExp",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~RegExp",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 59,
    "kind": "external",
    "name": "Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Array",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 60,
    "kind": "external",
    "name": "Int8Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Int8Array",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 61,
    "kind": "external",
    "name": "Uint8Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Uint8Array",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 62,
    "kind": "external",
    "name": "Uint8ClampedArray",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Uint8ClampedArray",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 63,
    "kind": "external",
    "name": "Int16Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Int16Array",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 64,
    "kind": "external",
    "name": "Uint16Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Uint16Array",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 65,
    "kind": "external",
    "name": "Int32Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Int32Array",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 66,
    "kind": "external",
    "name": "Uint32Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Uint32Array",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 67,
    "kind": "external",
    "name": "Float32Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Float32Array",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 68,
    "kind": "external",
    "name": "Float64Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Float64Array",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 69,
    "kind": "external",
    "name": "Map",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Map",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 70,
    "kind": "external",
    "name": "Set",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Set",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 71,
    "kind": "external",
    "name": "WeakMap",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~WeakMap",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 72,
    "kind": "external",
    "name": "WeakSet",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~WeakSet",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 73,
    "kind": "external",
    "name": "ArrayBuffer",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~ArrayBuffer",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 74,
    "kind": "external",
    "name": "DataView",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~DataView",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 75,
    "kind": "external",
    "name": "JSON",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~JSON",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 76,
    "kind": "external",
    "name": "Promise",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Promise",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 77,
    "kind": "external",
    "name": "Generator",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Generator",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 78,
    "kind": "external",
    "name": "GeneratorFunction",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~GeneratorFunction",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 79,
    "kind": "external",
    "name": "Reflect",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Reflect",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 80,
    "kind": "external",
    "name": "Proxy",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "static": true,
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Proxy",
    "access": null,
    "description": "",
    "lineNumber": 193,
    "builtinExternal": true
  },
  {
    "__docId__": 82,
    "kind": "external",
    "name": "CanvasRenderingContext2D",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D",
    "memberof": "BuiltinExternal/WebAPIExternal.js",
    "static": true,
    "longname": "BuiltinExternal/WebAPIExternal.js~CanvasRenderingContext2D",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 83,
    "kind": "external",
    "name": "DocumentFragment",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment",
    "memberof": "BuiltinExternal/WebAPIExternal.js",
    "static": true,
    "longname": "BuiltinExternal/WebAPIExternal.js~DocumentFragment",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 84,
    "kind": "external",
    "name": "Element",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/Element",
    "memberof": "BuiltinExternal/WebAPIExternal.js",
    "static": true,
    "longname": "BuiltinExternal/WebAPIExternal.js~Element",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 85,
    "kind": "external",
    "name": "Event",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/Event",
    "memberof": "BuiltinExternal/WebAPIExternal.js",
    "static": true,
    "longname": "BuiltinExternal/WebAPIExternal.js~Event",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 86,
    "kind": "external",
    "name": "Node",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/Node",
    "memberof": "BuiltinExternal/WebAPIExternal.js",
    "static": true,
    "longname": "BuiltinExternal/WebAPIExternal.js~Node",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 87,
    "kind": "external",
    "name": "NodeList",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/NodeList",
    "memberof": "BuiltinExternal/WebAPIExternal.js",
    "static": true,
    "longname": "BuiltinExternal/WebAPIExternal.js~NodeList",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 88,
    "kind": "external",
    "name": "XMLHttpRequest",
    "externalLink": "https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest",
    "memberof": "BuiltinExternal/WebAPIExternal.js",
    "static": true,
    "longname": "BuiltinExternal/WebAPIExternal.js~XMLHttpRequest",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 89,
    "kind": "external",
    "name": "AudioContext",
    "externalLink": "https://developer.mozilla.org/en/docs/Web/API/AudioContext",
    "memberof": "BuiltinExternal/WebAPIExternal.js",
    "static": true,
    "longname": "BuiltinExternal/WebAPIExternal.js~AudioContext",
    "access": null,
    "description": "",
    "lineNumber": 34,
    "builtinExternal": true
  }
]