<commit_before>'use strict';


const { deepMerge } = require('../utilities');


class LogInfo {

  constructor() {
    this.info = {};
  }

  add(obj) {
    this.info = deepMerge(this.info, obj);
  }

  // TODO: maybe allow this only once
  get() {
    return this.info;
  }

}


module.exports = {
  LogInfo,
};<commit_msg>Force calling logInfo.get() only once<commit_after>'use strict';


const { deepMerge, onlyOnce } = require('../utilities');


class LogInfo {

  constructor() {
    this[infoSym] = {};
    this.get = onlyOnce(() => this[infoSym]);
  }

  add(obj) {
    this[infoSym] = deepMerge(this[infoSym], obj);
  }

}

const infoSym = Symbol('info');


module.exports = {
  LogInfo,
};
{'fraction_non_alphanumeric': 0.17621776504297995, 'fraction_numerical': 0.0, 'mean_word_length': 3.087719298245614, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '5768961', 'n_tokens_mistral': 254, 'n_tokens_neox': 242, 'n_words': 50}