<commit_before>var t = require('tap');
var requireTransform = require('../lib/require-transform');

var src = "var foo = require('bar');";

var out = requireTransform(src, false);
t.match(out, /__mendel_require__\(/);
t.notMatch(out, /\brequire\(/);

out = requireTransform(src, true);
t.match(out, /__mendel_require__\(/);
t.notMatch(out, /\brequire\(/);

var wrapper = requireTransform.wrapper;
t.equal(out.indexOf(wrapper[0]), 0, 'wrapper prelude pos');
t.equal(out.indexOf(wrapper[1]), out.length - wrapper[1].length, 'wrapper epilogue pos');<commit_msg>Refactored regex.<commit_after>var t = require('tap');
var requireTransform = require('../lib/require-transform');

var mendelRequireRegexp = /__mendel_require__\(/;
var requireRegexp = /\brequire\(/;

var src = "var foo = require('bar');";

var out = requireTransform(src, false);
t.match(out, mendelRequireRegexp);
t.notMatch(out, requireRegexp);

out = requireTransform(src, true);
t.match(out, mendelRequireRegexp);
t.notMatch(out, requireRegexp);

var wrapper = requireTransform.wrapper;
t.equal(out.indexOf(wrapper[0]), 0, 'wrapper prelude pos');
t.equal(out.indexOf(wrapper[1]), out.length - wrapper[1].length, 'wrapper epilogue pos');
{'fraction_non_alphanumeric': 0.18333333333333332, 'fraction_numerical': 0.006666666666666667, 'mean_word_length': 6.106508875739645, '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': '2456198', 'n_tokens_mistral': 416, 'n_tokens_neox': 408, 'n_words': 86}