<commit_before>var through = require("through2")
  , falafel = require("falafel")

module.exports = function (file, opts) {
  if (/\.json$/.test(file)) return through()

  opts = opts || {}
  opts.replacement = opts.replacement || opts.r || ""

  var data = ""

  return through(
    function (buf, enc, cb) {
      data += buf
      cb()
    },
    function (cb) {
      try {
        this.push(String(parse(data, opts)))
      } catch (er) {
        cb(new Error(er.toString().replace("Error: ", "") + " (" + file + ")"))
      }
      cb()
    }<commit_msg>Fix potential double callback call<commit_after>var through = require("through2")
  , falafel = require("falafel")

module.exports = function (file, opts) {
  if (/\.json$/.test(file)) return through()

  opts = opts || {}
  opts.replacement = opts.replacement || opts.r || ""

  var data = ""

  return through(
    function (buf, enc, cb) {
      data += buf
      cb()
    },
    function (cb) {
      try {
        this.push(String(parse(data, opts)))
      } catch (er) {
        return cb(new Error(er.toString().replace("Error: ", "") + " (" + file + ")"))
      }
      cb()
    }
{'fraction_non_alphanumeric': 0.18641114982578397, 'fraction_numerical': 0.0017421602787456446, 'mean_word_length': 2.399408284023669, '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': '2164687', 'n_tokens_mistral': 382, 'n_tokens_neox': 374, 'n_words': 85}