<commit_before>const environment = require('./environment')

/**
 * Evaluates an AST for a Creative Property Expression (CPE)
 * in an environment.
 *
 * @param ast Abstract syntax tree of a CPE to evaluate.
 * @param env Environment to evaluate the AST in.
 */
function evaluateAST (ast, env) {
  function recurse (ast) {
    return evaluateAST(ast, env)
  }

  if (typeof ast === 'string') {
    return ast
  }
  if (typeof ast === 'number') {
    return ast
  }
  if (Array.isArray(ast)) {
    return ast.reduce((a, e) => [a].concat(recurse(e)).join(''), '')
  }
  if (typeof ast === 'object') {
    switch (ast.type) {
      case 'ref':
        if (typeof ast.name !== 'string' ||
            !Number.isInteger(ast.rank) ||<commit_msg>Don't use Number.isInteger for IE support<commit_after>const environment = require('./environment')

/**
 * Evaluates an AST for a Creative Property Expression (CPE)
 * in an environment.
 *
 * @param ast Abstract syntax tree of a CPE to evaluate.
 * @param env Environment to evaluate the AST in.
 */
function evaluateAST (ast, env) {
  function recurse (ast) {
    return evaluateAST(ast, env)
  }

  if (typeof ast === 'string') {
    return ast
  }
  if (typeof ast === 'number') {
    return ast
  }
  if (Array.isArray(ast)) {
    return ast.reduce((a, e) => [a].concat(recurse(e)).join(''), '')
  }
  if (typeof ast === 'object') {
    switch (ast.type) {
      case 'ref':
        if (typeof ast.name !== 'string' ||
            !(ast.rank === (ast.rank ^ 0)) ||
{'fraction_non_alphanumeric': 0.16037110669317428, 'fraction_numerical': 0.0006626905235255136, 'mean_word_length': 2.9220779220779223, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5167960', 'n_tokens_mistral': 484, 'n_tokens_neox': 475, 'n_words': 155}