<commit_before>"use strict";

var Base = require('./')
var util = require('../util')

exports.$removeUpdateParent = function( parent, event ) {
  //has to emit property and change
  delete parent[this._$key]
}

exports.$removeInternal = function( event, excludes, passon ) {
  var parent = this._$parent
  
  if( parent ) {
    this.$removeUpdateParent( parent, event )
  }

  for( var key$ in this ) {
    if( this.hasOwnProperty( key$ ) ) {
      var property = this[key$]

      //also add function support
      if( !excludes || 
          ( typeof excludes === 'function' 
            ? !excludes( this[key$], key$, this, passon ) 
            : key$ !== excludes 
          )
      ) {
        if( property instanceof Base ) {
          if(key$ !== '_$val') {
            property.remove( event )
          } else {
            console.error('remove _$val')
          }
        }  
        delete this[key$]
      }
      //much rather null (perf)
    }
  }
  this._$val = null
}

exports.remove = function( event, excludes, passon ) {
  if( this._$val === null ) {
    console.warn( 'allready removed' )
    return true
  }
  return this.$removeInternal( event, excludes, passon )
}
<commit_msg>no exclude on remove , will be added to empty / clear does not make sense on remove (perf) #3<commit_after>"use strict";

var Base = require('./')
var util = require('../util')

exports.$removeUpdateParent = function( parent, event ) {
  //has to emit property and change
  delete parent[this._$key]
}

exports.$removeInternal = function( event ) {
  var parent = this._$parent
  
  if( parent ) {
    this.$removeUpdateParent( parent, event )
  }

  for( var key$ in this ) {
    if( this.hasOwnProperty( key$ ) ) {
      var property = this[key$]

      if( property instanceof Base ) {
        if(key$ !== '_$val') {
          property.remove( event )
        } else {
          console.error('remove _$val')
        }
      }  
      delete this[key$]
      //much rather null (perf)
    }
  }
  this._$val = null
}

exports.remove = function( event ) {
  if( this._$val === null ) {
    console.warn( 'allready removed' )
    return true
  }
  return this.$removeInternal( event )
}

{'fraction_non_alphanumeric': 0.13926940639269406, 'fraction_numerical': 0.00045662100456621003, 'mean_word_length': 2.2315634218289087, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4467824', 'n_tokens_mistral': 683, 'n_tokens_neox': 667, 'n_words': 189}