<commit_before>'use strict';

const predicates = require('./predicates');
const predicate = module.exports;

// chaining mixin
class Lazy {
  constructor() {
    this.lazy = [];
  }

  valueOf() {
    return this.val();
  }

  val() {
    return this.lazy.map(function (args) {
      return args[0].apply(null, args[1]);
    })[this.method](predicates.truthy);
  }
}<commit_msg>improve perf around lazy eval in chaining<commit_after>'use strict';

const predicates = require('./predicates');
const predicate = module.exports;

// chaining mixin
class Lazy {
  constructor() {
    this.lazy = [];
  }

  valueOf() {
    return this.val();
  }

  val() {
    return this.lazy[this.method](function(args) {
      return args[0].apply(null, args[1]);
    });
  }
}
{'fraction_non_alphanumeric': 0.16842105263157894, 'fraction_numerical': 0.005263157894736842, 'mean_word_length': 3.227777777777778, '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': '7337696', 'n_tokens_mistral': 264, 'n_tokens_neox': 252, 'n_words': 54}