<commit_before>// Object
Object.prototype.blank = function(){
  if(this === null) return true;

  for(var prop in this){
    if(this.hasOwnProperty(prop)){
      return false;
    }
  }

  return true;
};

// String

String.prototype.trim = function(){
  return $.trim(this);
};

String.prototype.blank = function(){
  return this.trim() == '';
};

// Array

Array.prototype.compact = function(){
  for(var i=1; i<this.length; i++){
    if(this[i] == undefined || this[i] == null || this[i].blank()){
      this.splice(i, 1);
      i--;
    }
  }
  return this;
};

Array.prototype.includes = function(what){
  if(typeof what == 'object'){
    var re = new RegExp(what);
    for(var i=0; i<this.length; i++){
      if(re.test(this[i].toString())){
        return true;
      }
    }
  }else{
    for(var i=0; i<this.length; i++){
      if(this[i] == what){
        return true;
      }
    }
  }
  return false;
};

Array.prototype.flatten = function(){
  var b = Array.prototype.concat.apply([], this);
  if(b.length != this.length){
    b = b.flatten();
  };

  return b;
};

Array.prototype.blank = function(){
  return this.compact().length == 0;
};

// Boolean

Boolean.prototype.blank = function(){
  return this === false;
};

// Number

Number.prototype.blank = function(){
  return this <= 0;
};<commit_msg>Fixes array compact issue with zero index<commit_after>// Object
Object.prototype.blank = function(){
  if(this === null) return true;

  for(var prop in this){
    if(this.hasOwnProperty(prop)){
      return false;
    }
  }

  return true;
};

// String

String.prototype.trim = function(){
  return $.trim(this);
};

String.prototype.blank = function(){
  return this.trim() == '';
};

// Array

Array.prototype.compact = function(){
  for(var i=0; i<this.length; i++){
    if(this[i] == undefined || this[i] == null || this[i].blank()){
      this.splice(i, 1);
      i--;
    }
  }
  return this;
};

Array.prototype.includes = function(what){
  if(typeof what == 'object'){
    var re = new RegExp(what);
    for(var i=0; i<this.length; i++){
      if(re.test(this[i].toString())){
        return true;
      }
    }
  }else{
    for(var i=0; i<this.length; i++){
      if(this[i] == what){
        return true;
      }
    }
  }
  return false;
};

Array.prototype.flatten = function(){
  var b = Array.prototype.concat.apply([], this);
  if(b.length != this.length){
    b = b.flatten();
  };

  return b;
};

Array.prototype.blank = function(){
  return this.compact().length == 0;
};

// Boolean

Boolean.prototype.blank = function(){
  return this === false;
};

// Number

Number.prototype.blank = function(){
  return this <= 0;
};
{'fraction_non_alphanumeric': 0.1924812030075188, 'fraction_numerical': 0.004511278195488722, 'mean_word_length': 2.796005706134094, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, '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': '2216568', 'n_tokens_mistral': 934, 'n_tokens_neox': 919, 'n_words': 204}