Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

karma-handlebars-preprocessor

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma-handlebars-preprocessor - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

19

index.js

@@ -32,8 +32,15 @@ var handlebars = require('handlebars');

try {
processed = "(function() {" + templates + " = " + templates + " || {};" +
templates + "['" + template + "'] = Handlebars.template(" +
handlebars.precompile(content) + ");})();";
} catch (e) {
log.error('%s\n at %s', e.message, file.originalPath);
if(config.amd) {
processed = "define(['handlebars'], function(Handlebars) {\n" +
" return Handlebars.template(" + handlebars.precompile(content) + ");\n" +
"});";
} else {
try {
processed = "(function() {" + templates + " = " + templates + " || {};" +
templates + "['" + template + "'] = Handlebars.template(" +
handlebars.precompile(content) + ");})();";
} catch (e) {
log.error('%s\n at %s', e.message, file.originalPath);
}
}

@@ -40,0 +47,0 @@

{
"name": "karma-handlebars-preprocessor",
"version": "0.2.0",
"version": "0.3.0",
"description": "A Karma plugin. Compile handlebars template on the fly.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -68,2 +68,13 @@ # karma-handlebars-preprocessor

### AMD Based Template Configuration
If you want to export your compiled templates as anonymous AMD modules,
use the `amd` option in the config as shown below:
```js
handlebarsPreprocessor: {
amd: true
}
```
## License

@@ -70,0 +81,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc