<commit_before>'use strict';
var Page = require('./page');

/**
 * Represents a chapter.
 * @constructor
 * @implements {IChapter}
 * @param {string} address
 * @param {Array.<string>} identifier
 * @param {number} number
 * @param {?string} title
 * @param {number} volume
 */
function Chapter(address, identifier, number, title, volume) {
  this.address = address;
  this.identifier = identifier ? parseInt(identifier[1], 10) : undefined;
  this.number = number;
  this.title = title;
  this.volume = volume;
}

/**
 * Retrieves each child.
 * @param {?} $
 * @return {!Array.<!IPage>}
 */
Chapter.prototype.children = function($) {
  var i = 0;
  var match;
  var regex = /lstImages\.push\("(.+?)"\)/gi;
  var results = [];
  var text = $('script:contains(lstImages)').text();
  while ((match = regex.exec(text)) !== null) {
    results.push(new Page(match[1], i + 1));
    i += 1;
  }
  return results;
};

module.exports = Chapter;<commit_msg>Remove null usage<commit_after>'use strict';
var Page = require('./page');

/**
 * Represents a chapter.
 * @constructor
 * @implements {IChapter}
 * @param {string} address
 * @param {Array.<string>} identifier
 * @param {number} number
 * @param {?string} title
 * @param {number} volume
 */
function Chapter(address, identifier, number, title, volume) {
  this.address = address;
  this.identifier = identifier ? parseInt(identifier[1], 10) : undefined;
  this.number = number;
  this.title = title;
  this.volume = volume;
}

/**
 * Retrieves each child.
 * @param {?} $
 * @return {!Array.<!IPage>}
 */
Chapter.prototype.children = function($) {
  var i = 0;
  var match;
  var regex = /lstImages\.push\("(.+?)"\)/gi;
  var results = [];
  var text = $('script:contains(lstImages)').text();
  while ((match = regex.exec(text))) {
    results.push(new Page(match[1], i + 1));
    i += 1;
  }
  return results;
};

module.exports = Chapter;
{'fraction_non_alphanumeric': 0.18773135906927552, 'fraction_numerical': 0.007403490216816499, 'mean_word_length': 3.7418546365914787, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2126056', 'n_tokens_mistral': 644, 'n_tokens_neox': 624, 'n_words': 160}