<commit_before>/*!
 * connect-memcached
 * Copyright(c) 2012 <NAME> <<EMAIL>>
 * MIT Licensed
 */

var Memcached = require('memcached');
var oneDay = 86400;

/**
 * Return the `MemcachedStore` extending `connect`'s session Store.
 *
 * @param {object} connect
 * @return {Function}
 * @api public
 */

module.exports = function(connect) {
	var Store = connect.session.Store;

	/**
	 * Initialize MemcachedStore with the given `options`.
	 *
	 * @param {Object} options
	 * @api public
	 */
	function MemcachedStore(options) {
		options = options || {};
		Store.call(this, options);
		if (!options.hosts) {
			options.hosts = '127.0.0.1:11211';
		}

		if (options.prefix) {
			this.prefix = options.prefix;
		}

		this.client = new Memcached(options.hosts, options);
	}

	MemcachedStore.prototype.__proto__ = Store.prototype;<commit_msg>use the provided client, if given<commit_after>/*!
 * connect-memcached
 * Copyright(c) 2012 <NAME> <<EMAIL>>
 * MIT Licensed
 */

var Memcached = require('memcached');
var oneDay = 86400;

/**
 * Return the `MemcachedStore` extending `connect`'s session Store.
 *
 * @param {object} connect
 * @return {Function}
 * @api public
 */
module.exports = function(connect) {
	var Store = connect.session.Store;

	/**
	 * Initialize MemcachedStore with the given `options`.
	 *
	 * @param {Object} options
	 * @api public
	 */
	function MemcachedStore(options) {
		options = options || {};
		Store.call(this, options);

		this.prefix = options.prefix || '';
		if (!options.client) {
			if (!options.hosts) {
				options.hosts = '127.0.0.1:11211';
			}

			options.client = new Memcached(options.hosts, options);
		}

		this.client = options.client;
	}

	MemcachedStore.prototype.__proto__ = Store.prototype;
{'fraction_non_alphanumeric': 0.15198618307426598, 'fraction_numerical': 0.023028209556706966, 'mean_word_length': 3.6972972972972973, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '6477595', 'n_tokens_mistral': 626, 'n_tokens_neox': 549, 'n_words': 134}