<commit_before>import Ember from 'ember';

/**
 * @module ember-cli-storagekit
 * @submodule services
 */

/**
 * @class BaseStorageService
 * @extends Ember.Service
 * @public
 */

export default Ember.Service.extend({

  /**
   * The adapter being delegated to
   * @property {*} adapter
   * @private
   */
  adapter: null,

  /**
   * Delegates a setItem call to the underlying storage source
   * @method setItem
   * @param {String} key
   * @param {*} value
   * @public
   */
  setItem(key, value) {
    this.get('adapter').setItem(key, value);
  },

  /**
   * Delegates a getItem call to the underlying storage source
   * @method getItem
   * @param {String} key
   * @public
   */
  getItem(key) {
    return this.get('adapter').getItem(key);
  },

  /**
   * Delegates a removeItem call to the underlying storage source
   * @method removeItem
   * @param {String} key
   * @public
   */
  removeItem(key) {
    this.get('adapter').removeItem(key);
  },

  /**
   * Clears the underlying storage source
   * @method clear
   * @public
   */
  clear() {
    this.get('adapter').clear();
  },

  /**
   * Delegates a length call the underlying storage source
   * @method length
   * @public<commit_msg>Added key method to base-storage service<commit_after>import Ember from 'ember';

/**
 * @module ember-cli-storagekit
 * @submodule services
 */

/**
 * @class BaseStorageService
 * @extends Ember.Service
 * @public
 */

export default Ember.Service.extend({

  /**
   * The adapter being delegated to
   * @property {*} adapter
   * @private
   */
  adapter: null,

  /**
   * Delegates a setItem call to the underlying storage source
   * @method setItem
   * @param {String} key
   * @param {*} value
   * @public
   */
  setItem(key, value) {
    this.get('adapter').setItem(key, value);
  },

  /**
   * Delegates a getItem call to the underlying storage source
   * @method getItem
   * @param {String} key
   * @public
   */
  getItem(key) {
    return this.get('adapter').getItem(key);
  },

  /**
   * Delegates a removeItem call to the underlying storage source
   * @method removeItem
   * @param {String} key
   * @public
   */
  removeItem(key) {
    this.get('adapter').removeItem(key);
  },

  /**
   * Delegates a key call to the underlying storage source.
   * @method key
   * @param {Number} index The index of the key to retrieve.
   * @return {String|null} The key at the given index or null if it does not exist.
   */
  key(index) {
    return this.get('adapter').key(index);
  },

  /**
   * Clears the underlying storage source
   * @method clear
   * @public
   */
  clear() {
    this.get('adapter').clear();
  },

  /**
   * Delegates a length call the underlying storage source
   * @method length
   * @public
{'fraction_non_alphanumeric': 0.13694151834362514, 'fraction_numerical': 0.0, 'mean_word_length': 2.7367706919945727, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5299520', 'n_tokens_mistral': 888, 'n_tokens_neox': 876, 'n_words': 249}