Socket
Socket
Sign inDemoInstall

ember-cli-htmlbars

Package Overview
Dependencies
Maintainers
2
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-htmlbars - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

LICENSE.md

15

index.js

@@ -29,3 +29,2 @@ 'use strict';

this.registerPlugins();
this.initializeFeatures();
}

@@ -54,16 +53,2 @@

TemplateCompiler.prototype.initializeFeatures = function initializeFeatures() {
var EmberENV = this.options.EmberENV;
var FEATURES = this.options.FEATURES;
var templateCompiler = this.options.templateCompiler;
if (FEATURES) {
console.warn('Using `options.FEATURES` with ember-cli-htmlbars is deprecated. Please provide the full EmberENV as options.EmberENV instead.');
EmberENV = EmberENV || {};
EmberENV.FEATURES = FEATURES;
}
utils.initializeEmberENV(templateCompiler, EmberENV);
};
TemplateCompiler.prototype.processString = function (string, relativePath) {

@@ -70,0 +55,0 @@ return 'export default ' + utils.template(this.options.templateCompiler, stripBom(string), {

2

package.json
{
"name": "ember-cli-htmlbars",
"version": "1.0.3",
"version": "1.0.4",
"description": "A library for adding htmlbars to ember CLI",

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

@@ -55,19 +55,2 @@ 'use strict';

it('passes FEATURES to compiler when provided as `FEATURES` [DEPRECATED]', function(){
htmlbarsOptions.FEATURES = {
'ember-htmlbars-component-generation': true
};
var tree = templateCompilerFilter(sourcePath, htmlbarsOptions);
builder = new broccoli.Builder(tree);
return builder.build().then(function(results) {
var actual = fs.readFileSync(results.directory + '/web-component-template.js', { encoding: 'utf8'});
var source = fs.readFileSync(sourcePath + '/web-component-template.hbs', { encoding: 'utf8' });
var expected = 'export default Ember.HTMLBars.template(' + htmlbarsPrecompile(source, { moduleName: 'web-component-template.hbs' }) + ');';
assert.equal(actual,expected,'They dont match!');
});
});
it('passes FEATURES to compiler when provided as `EmberENV.FEATURES`', function(){

@@ -74,0 +57,0 @@ htmlbarsOptions.EmberENV = {

'use strict';
module.exports = {
initializeEmberENV: function(templateCompiler, EmberENV) {
if (!templateCompiler || !EmberENV) { return; }
var props;
if (EmberENV.FEATURES) {
props = Object.keys(EmberENV.FEATURES);
props.forEach(function(prop) {
templateCompiler._Ember.FEATURES[prop] = EmberENV.FEATURES[prop];
});
}
if (EmberENV) {
props = Object.keys(EmberENV);
props.forEach(function(prop) {
if (prop === 'FEATURES') { return; }
templateCompiler._Ember.ENV[prop] = EmberENV[prop];
});
}
},
template: function(templateCompiler, string, options) {

@@ -29,0 +5,0 @@ var precompiled = templateCompiler.precompile(string, options);

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