<commit_before>'use strict';

// Load library modules
const PoolCore = require('./lib/pool');

// Build instance
class MySQLPoolManagerInstance extends PoolCore {
  // Initial constructor
  constructor(options) {
    // Allow access to 'this'
    super();
    // Bind methods
    ['config'].forEach(func => (this[func] = this[func].bind(this)));
    // Check configuration
    return this.config(options);
  }

  // Function: Assign settings
  config(options) {
    // Define required properties
    const props = [
      'idlePoolTimeout',
      'errorLimit',
      'preInitDelay',
      'sessionTimeout',
      'maxConnextionTimeout',
      'idleCheckInterval',
    ];
    // Validation configuration
    props.forEach(prop => {
      if (!options.hasOwnProperty(prop)) {
        throw new Error(`The required property ${prop} is not defined!`);
      }
      if (typeof options[prop] !== 'number' && props.includes(prop)) {
        throw new Error(`The property ${prop} is not a number!`);
      }
    });
    // Check mysql settings are defined
    if (typeof options.mySQLSettings !== 'object') {
      throw new Error(`MySQL settings are not defined or not an object!`);
    }<commit_msg>super() returns 'this'<commit_after>'use strict';

// Load library modules
const PoolCore = require('./lib/pool');

// Build instance
class MySQLPoolManagerInstance extends PoolCore {
  // Initial constructor
  constructor(options) {
    // Allow access to 'this'
    super();
    // Bind methods
    ['config'].forEach(func => (this[func] = this[func].bind(this)));
    console.log('MySQLPoolManagerInstance', this);
    // Check configuration
    return this.config(options);
  }

  // Function: Assign settings
  config(options) {
    // Define required properties
    const props = [
      'idlePoolTimeout',
      'errorLimit',
      'preInitDelay',
      'sessionTimeout',
      'maxConnextionTimeout',
      'idleCheckInterval',
    ];
    // Validation configuration
    props.forEach(prop => {
      if (!options.hasOwnProperty(prop)) {
        throw new Error(`The required property ${prop} is not defined!`);
      }
      if (typeof options[prop] !== 'number' && props.includes(prop)) {
        throw new Error(`The property ${prop} is not a number!`);
      }
    });
    // Check mysql settings are defined
    if (typeof options.mySQLSettings !== 'object') {
      throw new Error(`MySQL settings are not defined or not an object!`);
    }
{'fraction_non_alphanumeric': 0.13602941176470587, 'fraction_numerical': 0.0, 'mean_word_length': 2.8873015873015873, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1899925', 'n_tokens_mistral': 666, 'n_tokens_neox': 670, 'n_words': 192}