<commit_before>'use strict'
var matchers = require('./matchers')
var Test = require('./Test')

function dsl (target) {
  Object.assign(target || global, dsl.matchers(), { test: dsl.test })
}

dsl.matchers = () => {
  return Object.keys(matchers).reduce((memo, matcher) => {
    var Class = matchers[matcher]
    memo[matcher.toLowerCase()] = (arg1, arg2) => new Class(arg1, arg2)
    return memo
  }, {})
}

// Use function instead of arrow to support arguments
dsl.test = function (name, subject) {
  return new Test(name, subject, Array.from(arguments).slice(2))
}

module.exports = dsl<commit_msg>Support falsy targets<commit_after>'use strict'
var matchers = require('./matchers')
var Test = require('./Test')

function dsl (target) {
  Object.assign(target === undefined ? global : target,
                dsl.matchers(),
                { test: dsl.test })
}

dsl.matchers = () => {
  return Object.keys(matchers).reduce((memo, matcher) => {
    var Class = matchers[matcher]
    memo[matcher.toLowerCase()] = (arg1, arg2) => new Class(arg1, arg2)
    return memo
  }, {})
}

// Use function instead of arrow to support arguments
dsl.test = function (name, subject) {
  return new Test(name, subject, Array.from(arguments).slice(2))
}

module.exports = dsl
{'fraction_non_alphanumeric': 0.15927099841521394, 'fraction_numerical': 0.00792393026941363, 'mean_word_length': 3.730337078651685, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3564070', 'n_tokens_mistral': 408, 'n_tokens_neox': 415, 'n_words': 103}