Comparing version 0.0.1 to 0.0.2
32
index.js
module.exports = function (bundle) { | ||
module.exports = function(extra_extensions) { | ||
var extensions = [ | ||
@@ -7,16 +7,26 @@ '.text', | ||
'.html', | ||
'.tmpl', | ||
'.hjs', | ||
'.hbs', | ||
'.hogan', | ||
'.handlebars' | ||
'.tmpl' | ||
]; | ||
var text_handler = function (body, file) { | ||
return 'module.exports = "' + body + '";\n'; | ||
if (Object.prototype.toString.call(extra_extensions) !== '[object Array]') { | ||
extra_extensions = []; | ||
} | ||
for (var i = 0; i < extra_extensions.length; i++) { | ||
if (extensions[extra_extensions[i]]) { continue; } | ||
extensions.push(extra_extensions[i]); | ||
} | ||
var middleware = function (bundle) { | ||
var text_handler = function (body, file) { | ||
return 'module.exports = "' + body + '";\n'; | ||
}; | ||
for (var i = 0; i < extensions.length; i++) { | ||
bundle.register(extensions[i], text_handler); | ||
} | ||
}; | ||
for (var i = 0; i < extensions.length; i++) { | ||
bundle.register(extensions[i], text_handler); | ||
} | ||
return middleware; | ||
}; |
{ | ||
"name": "stringify", | ||
"description": "Browserify plugin to require() text files (templates) inside of your client-side JavaScript files.", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"main": "./index.js", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1387
24