<commit_before>var fs = require('fs');
var zlib = require('zlib');
var UglifyJS = require('uglify-js');

function wrapScript(module, scriptPath, callback) {

    var relPath = module.getVersionPath() + scriptPath;
    var absPath = M.config.MODULE_ROOT + relPath;

    fs.readFile(absPath, function(err, data) {

        if (err) { return callback(err); }

        var content =
            'M.wrap(\'' + relPath + '\', function (require, module, exports) {\n' +
            data.toString() +
            '\nreturn module; });';
        <commit_msg>don't wrap client js files, if wrapping already exists<commit_after>var fs = require('fs');
var zlib = require('zlib');
var UglifyJS = require('uglify-js');

function wrapScript(module, scriptPath, callback) {

    var relPath = module.getVersionPath() + scriptPath;
    var absPath = M.config.MODULE_ROOT + relPath;

    fs.readFile(absPath, function(err, data) {

        if (err) { return callback(err); }
        
        var content = data.toString();
        if (content.indexOf('M.wrap') === -1) {
            content = 'M.wrap(\'' + relPath + '\', function (require, module, exports) {\n' +
            content + '\nreturn module; });';
        }

{'fraction_non_alphanumeric': 0.15614617940199335, 'fraction_numerical': 0.0008305647840531562, 'mean_word_length': 2.8012618296529967, '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': '3185835', 'n_tokens_mistral': 374, 'n_tokens_neox': 364, 'n_words': 93}