<commit_before>/*
 * fis
 * http://fis.baidu.com/
 */

'use strict';
module.exports = function(content, file, conf){
    if(file.isMod || conf.wrapAll){
        //wrap
        if(conf.type === 'amd'){
            if(!/^\s*define\s*\(/.test(content)){
                content = 'define(\'' + file.getId() + '\', function(require, exports, module){\n\n' + content + '\n\n});';
            }
        } else {
            if(!/^\s*(?:[!(]\s*|void\s+)function\(/.test(content)){
                content = '!function(){\n\n' + content + '\n\n}();';
            }
        }
    }
    return content;
};<commit_msg>支持template功能<commit_after>/*
 * fis
 * http://fis.baidu.com/
 */

'use strict';
module.exports = function(content, file, conf){
    if(file.isMod || conf.wrapAll){
        //wrap
        if(conf.type === 'amd'){
            if(!/^\s*define\s*\(/.test(content)){
                content = 'define(\'' + file.getId() + '\', function(require, exports, module){\n\n' + content + '\n\n});';
            }
        } else if(conf.template) {
            content = String(conf.template).split('${content}').join(content);
        } else {
            if(!/^\s*(?:[!(]\s*|void\s+)function\(/.test(content)){
                content = '!function(){try{\n\n' + content + '\n\n}catch(e){}}();';
            }
        }
    }
    return content;
};
{'fraction_non_alphanumeric': 0.2406855439642325, 'fraction_numerical': 0.0, 'mean_word_length': 1.8819742489270386, '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': '1802601', 'n_tokens_mistral': 458, 'n_tokens_neox': 452, 'n_words': 66}