LocalStore

@param {Object} options
- {Number} max
- {Number} gcProbability
777578
function LocalStore (options) {
  options = options || {};

  options.max = Number(options.max);
  if (isNaN(options.max)) options.max = DEFAULT_MAX;
  this._max = options.max;

  options.gcProbability = Number(options.gcProbability);
  if (isNaN(options.gcProbability)) options.gcProbability = DEFAULT_PROBABILITY;
  this._gcProbability = options.gcProbability;

  options.path = options.path || DEFAULT_PATH;
  this._path = options.path;

  options.type = options.type || DEFAULT_TYPE;
  this._type = options.type;
  this._storage = getStorage(this._type, this._path);

  options.prefix = options.prefix || DEFAULT_PREFIX;
  this._prefix = options.prefix;

  debug('init: type=%s, prefix=%s, path=%s, max=%s, gcProbability=%s', this._type, this._prefix, this._path, this._max, this._gcProbability);

  this._setKeyTotal(this._itemLength());
  debug('keyTotal=%s', this._getKeyTotal());

  return this;
}
403328
function AerospikeStore (options) {
    if (!(this instanceof AerospikeStore)) {
      throw new TypeError('Cannot call AerospikeStore constructor as a function')
    }

    options = options || {}
    Store.call(this, options)

    this.as_namespace = options.namespace || 'test'
    this.as_set = options.set || 'express-session'
    this.ttl = options.ttl
    this.mapper = options.mapper || new DataMapper()

    if (options.serializer) {
      throw new Error('The `serializer` option is no longer supported - supply a custom data mapper instead.')
    }

    if (options.client) {
      this.client = options.client
    } else {
      this.client = Aerospike.client(options)
      this.client.connect(error => {
        if (error) {
          debug('ERROR - %s', error.message)
          process.nextTick(() => this._onDisconnected())
        } else {
          process.nextTick(() => this._onConnected())
        }
      })
    }

    this.connected = false
    this.client.on('nodeAdded', () => this._onConnected())
    this.client.on('disconnected', () => this._onDisconnected())
  }
671947
function hasLocalStorage() {
  if (!localstorage) {
    return false;
  }

  try {
    localstorage.setItem('0', '');
    localstorage.removeItem('0');
    return true;
  } catch (error) {
    return false;
  }
}
617068
function giveStore(ecModel) {
    var store = ecModel[ATTR];
    if (!store) {
        store = ecModel[ATTR] = [{}];
    }
    return store;
}
464113
function LocalStorageKeyEnvironment(key) {
  this.key = key;
  var store = this.onStorage = this.onStorage.bind(this);
  var storage;

  try {
    storage = window.localStorage;
    storage.setItem(key, storage.getItem(key));
  } catch (e) {
    storage = null;
  }

  this.storage = storage || {
    data: {},
    getItem: function(itemKey) {return this.data[itemKey]; },
    setItem: function(itemKey, val) {
      this.data[itemKey] = val;
      clearTimeout(this.storeEvent);
      this.storeEvent = setTimeout(store, 1);
    }
  };

  Environment.call(this);
}
513874
function StorageHandle() {
  this.storageSupport = storageSupportAnalyse();
  switch (this.storageSupport) {
    case 0:
      var exec = require('cordova/exec');
      this.storageHandlerDelegate = exec;
      break;
    case 1:
      var localStorageHandle = require('./LocalStorageHandle');
      this.storageHandlerDelegate = localStorageHandle;
      break;
    case 2:
      console.log("ALERT! localstorage isn't supported");
      break;
    default:
      console.log("StorageSupport Error");
      break;
  }
}
924150
function RedisTimeseriesStorage (options) {
    this.redisClient = options.redisClient;
    this.keyPrepend = "js:tss:";
    if (options.key) {
        this.keyPrepend += options.key+":";
    }
}
317772
function LocalfsStorageAttachments(options) {
  if(options.removePrefix) {
    this.prefix = options.removePrefix;
  }
  attachments.StorageProvider.call(this, options);
}
552570
function getLocalStorage() {
  if (!(localStorage && localStorage.getItem)) {
    return null;
  }

  let state = localStorage.getItem(disableStr);

  if (state === 'false') {
    state = false;
  } else if (state === 'true') {
    state = true;
  }

  return state;
}
280389
function createPersistStore(reduxStore) {
    var persistor = (0, _reduxPersist.persistStore)(reduxStore);
    var dispatch = persistor.dispatch,
        getState = persistor.getState;


    reduxStore.persistor = persistor;
    reduxStore.getState.persistor = getState;
    reduxStore.dispatch.persistor = dispatch;
    reduxStore.dispatch.persistor = Object.assign(reduxStore.dispatch.persistor, {
        flush: persistor.flush,
        pause: persistor.pause,
        persist: persistor.flush,
        purge: persistor.purge
    });

    return reduxStore;
}
1221598
function MemcacheStore (options) {
  options = options || {};
  this._host = options.host || '127.0.0.1';
  this._port = options.port || 11211;
  this._prefix = options.prefix || '';
  this._user = options.user || '';
  this._password = options.password || '';
  this._pool = options.pool = (options.pool > 1 ? options.pool : 1);
  this._connectionString = this._user + ':' + this._password + '@' + this._host + ':' + this._port;

  debug('create: host=%s, port=%s, prefix=%s, user=%s, password=%s', this._host, this._port, this._prefix, this._user, this._password);

  this._clients = [];
  this._clientIndex = -1;
  for (var i = 0; i < options.pool; i++) {
    this._clients.push(memjs.Client.create(this._connectionString));
  }

  return this;
}
914
function sinterstore(destination /* key-1, key-N, req*/) {
  var args = slice.call(arguments, 1)
    , req = typeof args[args.length - 1] === 'object'
      ? args[args.length - 1] : null;
  var list = this.sinter.apply(this, args);
  if(list.length) {
    this.setKey(
      destination, new Set(list), undefined, undefined, undefined, req);
  }
  return list.length;
}
1300961
function getLocals(options) {
    if (!options || !options.locals) {
      return self.options.locals;
    }

    return utils.extend({}, self.options.locals, options.locals);
  }
294516
function _processOptions (options) {
        // Options parsing
        var
            name,
            maxLen;
        if (options instanceof Array) {
            options = gpf.Parameter.parse([{
                name: "port",
                type: "number",
                defaultValue: 80,
                prefix: "port"
            }, {
                name: "root",
                type: "string",
                defaultValue: ".",
                prefix: "root"
            }, {
                name: "chunkSize",
                type: "number",
                defaultValue: 65536,
                prefix: "chunk"
            }, gpf.Parameter.VERBOSE, gpf.Parameter.HELP], options);
        }
        // Server boot trace
        console.log("GPF " + gpf.version() + " web server");
        if (options.root === ".") {
            options.root = process.cwd();
        }
        if (options.verbose) {
            maxLen = 0;
            for (name in options) {
                if (options.hasOwnProperty(name)) {
                    if (name.length > maxLen) {
                        maxLen = name.length;
                    }
                }
            }
            ++maxLen;
            for (name in options) {
                if (options.hasOwnProperty(name)) {
                    console.log([
                        "\t",
                        name,
                        (new Array(maxLen - name.length + 1)).join(" "),
                        ": ",
                        options[name]
                    ].join(""));
                }
            }
        }
        return options;
    }
187274
function copyOptions( options ) {
		var props = [
				'objectMode',
				'highWaterMark',
				'encoding'
			],
			copy = {},
			prop;

		for ( var i = 0; i < props.length; i++ ) {
			prop = props[ i ];
			if ( options.hasOwnProperty( prop ) ) {
				copy[ prop ] = options[ prop ];
			}
		}
		return copy;
	}
667990
function makeLocalContext (store, namespace, path) {
  const noNamespace = namespace === ''

  const local = {
    dispatch: noNamespace ? store.dispatch : (_type, _payload, _options) => {
      const args = unifyObjectStyle(_type, _payload, _options)
      const { payload, options } = args
      let { type } = args

      if (!options || !options.root) {
        type = namespace + type
        if (process.env.NODE_ENV !== 'production' && !store._actions[type]) {
          console.error(`[vuex] unknown local action type: ${args.type}, global type: ${type}`)
          return
        }
      }

      return store.dispatch(type, payload)
    },

    commit: noNamespace ? store.commit : (_type, _payload, _options) => {
      const args = unifyObjectStyle(_type, _payload, _options)
      const { payload, options } = args
      let { type } = args

      if (!options || !options.root) {
        type = namespace + type
        if (process.env.NODE_ENV !== 'production' && !store._mutations[type]) {
          console.error(`[vuex] unknown local mutation type: ${args.type}, global type: ${type}`)
          return
        }
      }

      store.commit(type, payload, options)
    }
  }

  // getters and state object must be gotten lazily
  // because they will be changed by vm update
  Object.defineProperties(local, {
    getters: {
      get: noNamespace
        ? () => store.getters
        : () => makeLocalGetters(store, namespace)
    },
    state: {
      get: () => getNestedState(store.state, path)
    }
  })

  return local
}
1075443
async function storeOptions(options){
    await _fs.writeFile(_configFilename, JSON.stringify(options, null, 4));
}