<commit_before>'use strict'

import './polyfill'

// API implementations
import allDocs from './all_docs'
import bulkDocs from './bulk_docs'
import changes from './changes'
import destroy from './destroy'
import doCompaction from './do_compaction'
import get from './get'
import getAttachment from './get_attachment'
import getRevisionTree from './get_revision_tree'
import info from './info'

import { get as getDatabase, close as closeDatabase } from './databases'

const ADAPTER_NAME = 'asyncstorage'

function AsyncStoragePouch (dbOpts, constuctorCallback) {
  const api = this

  api.type = () => ADAPTER_NAME

  api._id = callback => {
    getDatabase(dbOpts)
      .then(database => sequence(cb => cb(null, database.meta.db_uuid), callback))
      .catch(callback)
  }
  api._info = callback => {
    getDatabase(dbOpts)
      .then(database => sequence(cb => info(database, cb), callback))
      .catch(callback)
  }
  api._get = (id, opts, callback) => {
    getDatabase(dbOpts)
      .then(database => sequence(cb => get(database, id, opts, cb), callback))
      .catch(callback)
  }
  api._getAttachment = (docId, attachId, attachment, opts, callback) => {
    getDatabase(dbOpts)
      .then(database => sequence(cb => getAttachment(database, docId, attachId, attachment, opts, cb), callback))
      .catch(callback)
  }
  api._getRevisionTree = (id, callback) => {
    getDatabase(dbOpts)
      .then(database => sequence(cb => getRevisionTree(database, id, cb), callback))
      .catch(callback)<commit_msg>Adding _remote to comply with PouchDB deprecation notice.<commit_after>'use strict'

import './polyfill'

// API implementations
import allDocs from './all_docs'
import bulkDocs from './bulk_docs'
import changes from './changes'
import destroy from './destroy'
import doCompaction from './do_compaction'
import get from './get'
import getAttachment from './get_attachment'
import getRevisionTree from './get_revision_tree'
import info from './info'

import { get as getDatabase, close as closeDatabase } from './databases'

const ADAPTER_NAME = 'asyncstorage'

function AsyncStoragePouch (dbOpts, constuctorCallback) {
  const api = this

  api._remote = false
  api.type = () => ADAPTER_NAME

  api._id = callback => {
    getDatabase(dbOpts)
      .then(database => sequence(cb => cb(null, database.meta.db_uuid), callback))
      .catch(callback)
  }
  api._info = callback => {
    getDatabase(dbOpts)
      .then(database => sequence(cb => info(database, cb), callback))
      .catch(callback)
  }
  api._get = (id, opts, callback) => {
    getDatabase(dbOpts)
      .then(database => sequence(cb => get(database, id, opts, cb), callback))
      .catch(callback)
  }
  api._getAttachment = (docId, attachId, attachment, opts, callback) => {
    getDatabase(dbOpts)
      .then(database => sequence(cb => getAttachment(database, docId, attachId, attachment, opts, cb), callback))
      .catch(callback)
  }
  api._getRevisionTree = (id, callback) => {
    getDatabase(dbOpts)
      .then(database => sequence(cb => getRevisionTree(database, id, cb), callback))
      .catch(callback)
{'fraction_non_alphanumeric': 0.13545688545688545, 'fraction_numerical': 0.0, 'mean_word_length': 3.896062992125984, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 35, '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': '523873', 'n_tokens_mistral': 939, 'n_tokens_neox': 941, 'n_words': 252}