<commit_before>const async = require('async');
const Handlebars = require('handlebars');
const render = require('consolidate').handlebars.render;

require('handlebars-helpers').string({
    handlebars: Handlebars
});

const logger = require('../logger');

Handlebars.registerHelper('if_eq', function ifEq(a, b, opts) {
    return a === b
        ? opts.fn(this)
        : opts.inverse(this);
});

Handlebars.registerHelper('unless_eq', function unlessEq(a, b, opts) {
    return a === b
        ? opts.inverse(this)
        : opts.fn(this);
});

module.exports = (files, metalsmith, done) => {

    const keys = Object.keys(files);
    const metadata = Object.assign(metalsmith.metadata(), { cache: false });<commit_msg>feat(middleware): handlebars helpers in render<commit_after>const async = require('async');
const Handlebars = require('handlebars');
const render = require('consolidate').handlebars.render;

require('handlebars-helpers')({
    handlebars: Handlebars
});

const logger = require('../logger');

Handlebars.registerHelper('if_eq', function ifEq(a, b, opts) {
    return a === b
        ? opts.fn(this)
        : opts.inverse(this);
});

Handlebars.registerHelper('unless_eq', function unlessEq(a, b, opts) {
    return a === b
        ? opts.inverse(this)
        : opts.fn(this);
});

module.exports = (files, metalsmith, done) => {

    const keys = Object.keys(files);
    const metadata = Object.assign(metalsmith.metadata(), { cache: false });
{'fraction_non_alphanumeric': 0.165075034106412, 'fraction_numerical': 0.0, 'mean_word_length': 4.058620689655172, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5970165', 'n_tokens_mistral': 454, 'n_tokens_neox': 442, 'n_words': 98}