<commit_before>import { Injectable } from '@angular/core'

import { AbstractStorageService } from '../AbstractStorageService'

declare const jIO: any

@Injectable()
export class LocalStorageService extends AbstractStorageService {

  private instance: any
  readonly name: string = 'Local Storage'

  constructor() {
    super()
    this.instance = jIO.createJIO({
      type: 'query',
      sub_storage: {
        type: 'uuid',
        sub_storage: {
          type: 'indexeddb',
          database: 'mute'
        }
      }
    })
  }

  get (name: string): Promise<any> {
    return this.instance.get(name)
  }

  put (name: string, object: any): Promise<string> {
    return this.instance.put(name, object)
  }

  isReachable (): Promise<boolean> {
    return Promise.resolve(true)
  }

  getDocuments (): Promise<any[]> {
    const docs = [
      {
        id: 'id1',
        title: 'title1'
      },
      {
        id: 'id2',
        title: 'title2'
      },
      {
        id: 'id3',
        title: 'title3'
      },
    ]
    return Promise.resolve(docs)<commit_msg>feat(localStorage): Implement getDocuments()<commit_after>import { Injectable } from '@angular/core'

import { AbstractStorageService } from '../AbstractStorageService'

declare const jIO: any

@Injectable()
export class LocalStorageService extends AbstractStorageService {

  private instance: any
  readonly name: string = 'Local Storage'

  constructor() {
    super()
    this.instance = jIO.createJIO({
      type: 'query',
      sub_storage: {
        type: 'uuid',
        sub_storage: {
          type: 'indexeddb',
          database: 'mute'
        }
      }
    })
  }

  get (name: string): Promise<any> {
    return this.instance.get(name)
  }

  put (name: string, object: any): Promise<string> {
    return this.instance.put(name, object)
  }

  isReachable (): Promise<boolean> {
    return Promise.resolve(true)
  }

  getDocuments (): Promise<any[]> {
    return this.instance.allDocs().then((response) => {
      return response.data.rows
    })
{'fraction_non_alphanumeric': 0.1303921568627451, 'fraction_numerical': 0.0029411764705882353, 'mean_word_length': 2.56195462478185, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, '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': '2140527', 'n_tokens_mistral': 643, 'n_tokens_neox': 626, 'n_words': 143}