<commit_before>/**
 * The Sea.js plugin for loading text resources such as template, json etc
 */

var global = window
var plugins = {}
var uriCache = {}

function register(o) {
  plugins[o.name] = o
}

// normal text
register({
  name: "text",

  ext: [".tpl", ".html"],

  exec: function(uri, content) {
    globalEval('define("' + uri + '#", [], "' + jsEscape(content) + '")')
  }
})

// json
register({
  name: "json",

  ext: [".json"],

  exec: function(uri, content) {
    globalEval('define("' + uri + '#", [], ' + content + ')')
  }
})

// for handlebars template
register({
  name: "handlebars",

  ext: [".handlebars"],

  exec: function(uri, content) {
    var code = [
      'define("' + uri + '#", ["handlebars"], function(require, exports, module) {',
      '  var source = "' + jsEscape(content) + '"',
      '  var Handlebars = require("handlebars")',
      '  module.exports = function(data, options) {',<commit_msg>support commonjs version of handlebars after 1.1.0<commit_after>/**
 * The Sea.js plugin for loading text resources such as template, json etc
 */

var global = window
var plugins = {}
var uriCache = {}

function register(o) {
  plugins[o.name] = o
}

// normal text
register({
  name: "text",

  ext: [".tpl", ".html"],

  exec: function(uri, content) {
    globalEval('define("' + uri + '#", [], "' + jsEscape(content) + '")')
  }
})

// json
register({
  name: "json",

  ext: [".json"],

  exec: function(uri, content) {
    globalEval('define("' + uri + '#", [], ' + content + ')')
  }
})

// for handlebars template
register({
  name: "handlebars",

  ext: [".handlebars"],

  exec: function(uri, content) {
    var code = [
      'define("' + uri + '#", ["handlebars"], function(require, exports, module) {',
      '  var source = "' + jsEscape(content) + '"',
      '  var Handlebars = require("handlebars")["default"]',
      '  module.exports = function(data, options) {',
{'fraction_non_alphanumeric': 0.20668058455114824, 'fraction_numerical': 0.0015657620041753654, 'mean_word_length': 3.2505543237250554, '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': '7012491', 'n_tokens_mistral': 645, 'n_tokens_neox': 635, 'n_words': 162}