<commit_before>var map = require('map-stream');
var rext = require('replace-ext');
var hamlc = require('haml-coffee');

module.exports = function(options) {
  if(!options) options = {};

  // Map each file to this function
  function hamlStream(file, cb) {
    if (file.isNull()) return cb(null, file); // pass along
    if (file.isStream()) return cb(new Error("gulp-haml-coffee: Streaming not supported"));

    // gulp-haml-coffee compiles to plain HTML per default. If the `js` option is set,
    // it will compile to a JS function.
    var output;
    if (options.js) {
      output = hamlc.template(file.contents.toString("utf8"), options.name, options.namespace, options);
      file.path = rext(file.path, ".js");
    } else {
      output = hamlc.render(file.contents.toString("utf8"), options.locals || {});
      file.path = rext(file.path, ".html");
    }<commit_msg>Pass options through to haml-coffe<commit_after>var map = require('map-stream');
var rext = require('replace-ext');
var hamlc = require('haml-coffee');

module.exports = function(options) {
  if(!options) options = {};

  // Map each file to this function
  function hamlStream(file, cb) {
    if (file.isNull()) return cb(null, file); // pass along
    if (file.isStream()) return cb(new Error("gulp-haml-coffee: Streaming not supported"));

    // gulp-haml-coffee compiles to plain HTML per default. If the `js` option is set,
    // it will compile to a JS function.
    var output;
    if (options.js) {
      output = hamlc.template(file.contents.toString("utf8"), options.name, options.namespace, options);
      file.path = rext(file.path, ".js");
    } else {
      output = hamlc.render(file.contents.toString("utf8"), options.locals || {}, options);
      file.path = rext(file.path, ".html");
    }
{'fraction_non_alphanumeric': 0.15754189944134078, 'fraction_numerical': 0.0022346368715083797, 'mean_word_length': 3.444168734491315, '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': '6128054', 'n_tokens_mistral': 573, 'n_tokens_neox': 560, 'n_words': 157}