<commit_before>var package = require('package')
var join = require('path').join

function merge (a, b) {
  for(var k in b) {
    a[k] = b[k]
  }
  return a
}

module.exports = function (start, opts) {
  start = start || process.cwd()
  var p = package({filename: join(start, 'package.json')})
  var m = !opts || opts.dev !== false
        ? merge(p.devDependencies, p.dependencies)
        : p.dependencies
  var a = []
  for(var k in m) a.push(k + '@' + m[k])
  return a
}

if(!module.parent)
  console.log(module.exports(process.argv[2]))
<commit_msg>Handle undefined destination in merge, target c for immutability<commit_after>var package = require('package')
var join = require('path').join

function merge (a, b) {
  var c = a || {}
  for(var k in b) {
    c[k] = b[k]
  }
  return c
}

module.exports = function (start, opts) {
  start = start || process.cwd()
  var p = package({filename: join(start, 'package.json')})
  var m = !opts || opts.dev !== false
        ? merge(p.devDependencies, p.dependencies)
        : p.dependencies
  var a = []
  for(var k in m) a.push(k + '@' + m[k])
  return a
}

if(!module.parent)
  console.log(module.exports(process.argv[2]))

{'fraction_non_alphanumeric': 0.1702127659574468, 'fraction_numerical': 0.001702127659574468, 'mean_word_length': 3.2763636363636364, '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': '28484', 'n_tokens_mistral': 424, 'n_tokens_neox': 417, 'n_words': 111}