<commit_before>/**
 * source.js
 * <NAME> - 2015
 */

/**
 * Extracts parts from the source code basing on line number and column number.
 * _src: Source code to provide
 */
module.exports = function(_src) {
  var validateSrc = function(src) {
    if (!src) {
      throw 'Error: src cannot be null or undefined!';
    }
    return src;
  };
  
  var src = validateSrc(_src);

  return {
    /**
     * Extracts source code at provided line number and col number.
     * rs: Row start.
     * re: Row end.
     * cs: Col start.
     * ce: Col end.
     */
    at: function(rs, re, cs, ce) {
      
    }
  };
};<commit_msg>Update source.js<commit_after>/**
 * source.js
 * <NAME> - 2015
 */

/**
 * Extracts parts from the source code basing on line number and column number.
 * _src: Source code to provide
 */
module.exports = function(_src) {
  var validateSrc = function(src) {
    if (!src || src.lenght <= 0) {
      throw 'Error: src cannot be null, undefined or an empty string!';
    }
    return src;
  };
  
  var src = validateSrc(_src);

  return {
    /**
     * Extracts source code at provided line number and col number.
     * rs: Row start.
     * re: Row end.
     * cs: Col start.
     * ce: Col end.
     */
    at: function(rs, re, cs, ce) {
      if (!rs || typeof rs !== 'number') {
        throw 'Error: Row start must be a number!';
      }
      if (!re || typeof re !== 'number') {
        throw 'Error: Row end must be a number!';
      }
      if (!cs || typeof cs !== 'number') {
        throw 'Error: Col start must be a number!';
      }
      if (!ce || typeof ce !== 'number') {
        throw 'Error: Col end must be a number!';
      }
      if (re < rs) {
        throw 'Error: Row end must be greater or equal than row start!';
      }
      if (ce < cs) {
        throw 'Error: Col end must be greater or equal than col start!';
      }
    }
  };
};
{'fraction_non_alphanumeric': 0.13597883597883598, 'fraction_numerical': 0.004761904761904762, 'mean_word_length': 2.011146496815287, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 5, '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': '599442', 'n_tokens_mistral': 613, 'n_tokens_neox': 597, 'n_words': 230}