<commit_before>/**
 * Module dependencies.
 */

var path = require('path');
var util = require('util');
var _ = require('@sailshq/lodash');
var flaverr = require('flaverr');
var Redis = require('machinepack-redis');

// (this dependency is just for creating new cookies)
var uid = require('uid-safe');

// (these two dependencies are only here for sails.session.parseSessionIdFromCookie(),
//  which is only here to enable socket lifecycle callbacks)
var parseCookie = require('cookie').parse;
var stringifyCookie = require('cookie').serialize;
var unsignCookie = require('cookie-signature').unsign;
var signCookie = require('cookie-signature').sign;
var pathToRegexp = require('path-to-regexp');

module.exports = function(app) {

  // `session` hook definition
  var SessionHook = {


    defaults: {
      session: {
        adapter: 'memory',
        name: 'sails.sid',
        // By default, disable session for requests to paths that look like static assets.
        isSessionDisabled: function (req){
          return !!req.path.match(req._sails.LOOKS_LIKE_ASSET_RX);
        },
        // Added overrideable function for constructing the session store based on https://github.com/balderdashy/sails/pull/7172
        // • `sessionConfig` is what Sails has loaded for sails.config.session
        // • `configuredSessionAdapter` is the package like what you get from doing require('connect-mongo')
        // • `expressSessionFromSailsCore` is the version of express-session used by Sails core session hook, provided for your convenience
        //    while this construction of the session store does not require expressSessionFromSailsCore, some constructions will
        handleConstructingSessionStore: (sessionConfig, configuredSessionAdapter, expressSessionFromSailsCore) => { // eslint-disable-line no-unused-vars
          return new configuredSessionAdapter(sessionConfig);
        }
      }
    },


    /**
     * Normalize and validate configuration for this hook.
     * Then fold any modifications back into `sails.config`
     */
    configure: function() {

      // Validate config
      // Ensure that session config is at least an object of some kind.
      if (app.config.session) {<commit_msg>Restore Construction Type<commit_after>/**
 * Module dependencies.
 */

var path = require('path');
var util = require('util');
var _ = require('@sailshq/lodash');
var flaverr = require('flaverr');
var Redis = require('machinepack-redis');

// (this dependency is just for creating new cookies)
var uid = require('uid-safe');

// (these two dependencies are only here for sails.session.parseSessionIdFromCookie(),
//  which is only here to enable socket lifecycle callbacks)
var parseCookie = require('cookie').parse;
var stringifyCookie = require('cookie').serialize;
var unsignCookie = require('cookie-signature').unsign;
var signCookie = require('cookie-signature').sign;
var pathToRegexp = require('path-to-regexp');

module.exports = function(app) {

  // `session` hook definition
  var SessionHook = {


    defaults: {
      session: {
        adapter: 'memory',
        name: 'sails.sid',
        // By default, disable session for requests to paths that look like static assets.
        isSessionDisabled: function (req){
          return !!req.path.match(req._sails.LOOKS_LIKE_ASSET_RX);
        },
        // Added overrideable function for constructing the session store based on https://github.com/balderdashy/sails/pull/7172
        // • `sessionConfig` is what Sails has loaded for sails.config.session
        // • `configuredSessionAdapter` is the package like what you get from doing require('connect-mongo')
        // • `expressSessionFromSailsCore` is the version of express-session used by Sails core session hook, provided for your convenience
        handleConstructingSessionStore: (sessionConfig, configuredSessionAdapter, expressSessionFromSailsCore) => {
          var CustomStore = configuredSessionAdapter(expressSessionFromSailsCore);
          return new CustomStore(sessionConfig);
        }
      }
    },


    /**
     * Normalize and validate configuration for this hook.
     * Then fold any modifications back into `sails.config`
     */
    configure: function() {

      // Validate config
      // Ensure that session config is at least an object of some kind.
      if (app.config.session) {
{'fraction_non_alphanumeric': 0.10401836969001148, 'fraction_numerical': 0.0018369690011481056, 'mean_word_length': 3.3822937625754528, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '2981408', 'n_tokens_mistral': 1157, 'n_tokens_neox': 1132, 'n_words': 379}