<commit_before>module.exports = function (grunt) {
    function createBanner(fileName) {
        return '/*\n' +
            '* ' + fileName + '\n' +
            '* http://github.com/RobinHerbots/jquery.inputmask\n' +
            '* Copyright (c) 2010 - <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
            '* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n' +
            '* Version: <%= pkg.version %>\n' +
            '*/\n';
    }

    function createUglifyConfig(path) {
        var uglifyConfig = {};
        var srcFiles = grunt.file.expand(path + "/*.js");
        for (var srcNdx in srcFiles) {
            var dstFile = srcFiles[srcNdx].replace("js/", "");
            wrapAMDLoader(srcFiles[srcNdx], "build/" + dstFile, dstFile.indexOf("extension") == -1 ? ["jquery"] : ["jquery", "./jquery.inputmask"]);
            uglifyConfig[dstFile] = {
                dest: 'dist/inputmask/' + dstFile,
                src: "build/" + dstFile,
                options: { banner: createBanner(dstFile) }
            };
        }

        srcFiles = grunt.file.expand(path + "/*.extensions.js");
        srcFiles.splice(0, 0, "js/jquery.inputmask.js");
        uglifyConfig["inputmaskbundle"] = {
            files: {
                'dist/<%= pkg.name %>.bundle.js': srcFiles
            },
            options: { banner: createBanner('<%= pkg.name %>.bundle') }
        }
        return uglifyConfig;
    }
    function wrapAMDLoader(src, dst, dependencies) {
        function stripClosureExecution() {
            return srcFile.replace(new RegExp("\\(jQuery\\).*$"), "");
        }

        var srcFile = grunt.file.read(src),
            dstContent = "(function (factory) {" +
                "if (typeof define === 'function' && define.amd) {" +
                "define(" + JSON.stringify(dependencies) + ", factory);" +
                "} else {" +
                "factory(jQuery);" +
                "}}" + stripClosureExecution() + ");";
        grunt.file.write(dst, dstContent);
    }

    // Project configuration.
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        uglify: createUglifyConfig("js"),
        clean: ["dist"],
        qunit: {
            files: ['qunit/qunit.html']
        }
    });

    // Load the plugin that provides the tasks.
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-qunit');
    grunt.loadNpmTasks('grunt-contrib-requirejs');

    // Default task(s).
    grunt.registerTask('default', ['clean', 'uglify']);

};<commit_msg>cleanup<commit_after>module.exports = function (grunt) {
    function createBanner(fileName) {
        return '/*\n' +
            '* ' + fileName + '\n' +
            '* http://github.com/RobinHerbots/jquery.inputmask\n' +
            '* Copyright (c) 2010 - <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
            '* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n' +
            '* Version: <%= pkg.version %>\n' +
            '*/\n';
    }

    function createUglifyConfig(path) {
        var uglifyConfig = {};
        var srcFiles = grunt.file.expand(path + "/*.js");
        for (var srcNdx in srcFiles) {
            var dstFile = srcFiles[srcNdx].replace("js/", "");
            wrapAMDLoader(srcFiles[srcNdx], "build/" + dstFile, dstFile.indexOf("extension") == -1 ? ["jquery"] : ["jquery", "./jquery.inputmask"]);
            uglifyConfig[dstFile] = {
                dest: 'dist/inputmask/' + dstFile,
                src: "build/" + dstFile,
                options: { banner: createBanner(dstFile) }
            };
        }

        srcFiles = grunt.file.expand(path + "/*.extensions.js");
        srcFiles.splice(0, 0, "js/jquery.inputmask.js");
        uglifyConfig["inputmaskbundle"] = {
            files: {
                'dist/<%= pkg.name %>.bundle.js': srcFiles
            },
            options: { banner: createBanner('<%= pkg.name %>.bundle') }
        }
        return uglifyConfig;
    }
    function wrapAMDLoader(src, dst, dependencies) {
        function stripClosureExecution() {
            return srcFile.replace(new RegExp("\\(jQuery\\).*$"), "");
        }

        var srcFile = grunt.file.read(src),
            dstContent = "(function (factory) {" +
                "if (typeof define === 'function' && define.amd) {" +
                "define(" + JSON.stringify(dependencies) + ", factory);" +
                "} else {" +
                "factory(jQuery);" +
                "}}" + stripClosureExecution() + ");";
        grunt.file.write(dst, dstContent);
    }

    // Project configuration.
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        uglify: createUglifyConfig("js"),
        clean: ["dist"],
        qunit: {
            files: ['qunit/qunit.html']
        }
    });

    // Load the plugin that provides the tasks.
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-qunit');

    // Default task(s).
    grunt.registerTask('default', ['clean', 'uglify']);

};
{'fraction_non_alphanumeric': 0.17333078247560743, 'fraction_numerical': 0.002678400612205854, 'mean_word_length': 1.989136649514008, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6362606', 'n_tokens_mistral': 1663, 'n_tokens_neox': 1590, 'n_words': 269}