<commit_before>import cookie from 'cookie'

let prefix = 'lS_'

export default class CookieStorage {
  constructor (options = {}) {
    this.cookieOptions = Object.assign({}, options, {path: '/'})
    prefix = options.prefix || prefix
  }

  getItem (key) {
    const cookies = cookie.parse(document.cookie)
    if (!cookies || !cookies.hasOwnProperty(prefix + key)) {
      return null
    }
    return cookies[prefix + key]
  }

  setItem (key, value) {<commit_msg>let user override 'path' if they wish, even though not recommended.<commit_after>import cookie from 'cookie'

let prefix = 'lS_'

export default class CookieStorage {
  constructor (options = {}) {
    this.cookieOptions = Object.assign({path: '/'}, options)
    prefix = options.prefix || prefix
  }

  getItem (key) {
    const cookies = cookie.parse(document.cookie)
    if (!cookies || !cookies.hasOwnProperty(prefix + key)) {
      return null
    }
    return cookies[prefix + key]
  }

  setItem (key, value) {
{'fraction_non_alphanumeric': 0.1290650406504065, 'fraction_numerical': 0.0, 'mean_word_length': 3.4170403587443947, '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': '312562', 'n_tokens_mistral': 299, 'n_tokens_neox': 296, 'n_words': 83}