<commit_before>/*!
 * assemble-handle <https://github.com/jonschlinkert/assemble-handle>
 *
 * Copyright (c) 2016, <NAME>.
 * Licensed under the MIT License.
 */

'use strict';

/**
 * Plugin for handling middleware
 *
 * @param {Object} `app` Instance of "app" (assemble, verb, etc) or a collection
 * @param {String} `stage` the middleware stage to run
 */

function handle(app, stage) {
  return utils.through.obj(function(file, enc, next) {
    if (typeof app.handle !== 'function') {
      return next(null, file);
    }
    if (typeof file.options === 'undefined') {
      return next(null, file);
    }
    if (file.isNull()) return next();
    app.handle(stage, file, next);
  });
}
<commit_msg>adds through<commit_after>/*!
 * assemble-handle <https://github.com/jonschlinkert/assemble-handle>
 *
 * Copyright (c) 2016, <NAME>.
 * Licensed under the MIT License.
 */

'use strict';

var through = require('through2');

/**
 * Plugin for handling middleware
 *
 * @param {Object} `app` Instance of "app" (assemble, verb, etc) or a collection
 * @param {String} `stage` the middleware stage to run
 */

module.exports = function handle(app, stage) {
  return through.obj(function(file, enc, next) {
    if (typeof app.handle !== 'function') {
      return next(null, file);
    }

    if (typeof file.options === 'undefined') {
      return next(null, file);
    }

    if (file.isNull()) return next();
    app.handle(stage, file, next);
  });
};
{'fraction_non_alphanumeric': 0.16368638239339753, 'fraction_numerical': 0.006189821182943604, 'mean_word_length': 3.4359756097560976, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '5667005', 'n_tokens_mistral': 478, 'n_tokens_neox': 466, 'n_words': 137}