<commit_before>
var utils = require('./utils')

class Leaf {
  constructor (config={}) {
    this.id = utils.unique_id()
    this.parent = null
    this.prev = null
    this.next = null
    this.children = []
    this.keys = []
    this.values = []
  }

  injectData (key, val=null) {
    if (val !== null) {
      var location = utils.binarySearch(this.keys, key)
      if (location.found) {
        var dataLocation = utils.binarySearch(this.values[location.index], val)
        utils.insertAt(this.values[location.index], val, dataLocation.index)
      } else {
        utils.insertAt(this.keys, key, location.index)
        utils.insertAt(this.values, [val], location.index)
      }
    }
  }

  ejectData (key, val) {
    var keyLocation = utils.binarySearch(this.keys, key)
    if (keyLocation.found) {<commit_msg>check for undefined instead<commit_after>
var utils = require('./utils')

class Leaf {
  constructor (config={}) {
    this.id = utils.unique_id()
    this.parent = null
    this.prev = null
    this.next = null
    this.children = []
    this.keys = []
    this.values = []
  }

  injectData (key, val) {
    if (typeof val !== 'undefined') {
      var location = utils.binarySearch(this.keys, key)
      if (location.found) {
        var dataLocation = utils.binarySearch(this.values[location.index], val)
        utils.insertAt(this.values[location.index], val, dataLocation.index)
      } else {
        utils.insertAt(this.keys, key, location.index)
        utils.insertAt(this.values, [val], location.index)
      }
    }
  }

  ejectData (key, val) {
    var keyLocation = utils.binarySearch(this.keys, key)
    if (keyLocation.found) {
{'fraction_non_alphanumeric': 0.14010823812387252, 'fraction_numerical': 0.0, 'mean_word_length': 2.6895787139689578, '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': '1719422', 'n_tokens_mistral': 534, 'n_tokens_neox': 537, 'n_words': 112}