<commit_before>'use strict'

const consolidate = require('consolidate')
const extend = require('extend-shallow')

exports.name = 'consolidate'
exports.outputFormat = 'html'

// Add all the inputFormats.
exports.inputFormats = []
Object.keys(consolidate).forEach(item => {
  if (['clearCache', 'requireReact', 'requires'].indexOf(item) <= -1) {
    exports.inputFormats.push(item)
  }
})

/**
 * Returns the name of the engine from the given options.
 */
function getEngineName(options) {
  if (typeof options === 'string' || options instanceof String) {
    return options
  } else if (typeof options === 'object' && options.engine) {
    return options.engine
  }
  throw new Error('options.engine not found.')
}

exports.renderAsync = function (str, options, locals) {
  const name = getEngineName(options)
  return consolidate[name].render(str, extend({}, options, locals))
}

exports.renderFileAsync = function (file, options, locals) {
  const name = getEngineName(options)
  return consolidate[name](file, extend({}, options, locals))
}<commit_msg>Update Boilerplate<commit_after>'use strict'

const consolidate = require('consolidate')
const extend = require('extend-shallow')

exports.name = 'consolidate'
exports.outputFormat = 'html'

// Add all the inputFormats.
exports.inputFormats = []
Object.keys(consolidate).forEach(item => {
  if (['clearCache', 'requireReact', 'requires'].indexOf(item) <= -1) {
    exports.inputFormats.push(item)
  }
})

/**
 * Returns the name of the engine from the given options.
 */
function getEngineName(options) {
  if (typeof options === 'string' || options instanceof String) {
    return options
  }
  if (typeof options === 'object' && options.engine) {
    return options.engine
  }
  throw new Error('options.engine not found.')
}

exports.renderAsync = function (str, options, locals) {
  const name = getEngineName(options)
  return consolidate[name].render(str, extend({}, options, locals))
}

exports.renderFileAsync = function (file, options, locals) {
  const name = getEngineName(options)
  return consolidate[name](file, extend({}, options, locals))
}
{'fraction_non_alphanumeric': 0.14312796208530806, 'fraction_numerical': 0.0009478672985781991, 'mean_word_length': 4.815426997245179, 'pattern_counts': {'":': 0, '<': 5, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2152911', 'n_tokens_mistral': 630, 'n_tokens_neox': 627, 'n_words': 168}