Socket
Socket
Sign inDemoInstall

babel-plugin-htmlbars-inline-precompile

Package Overview
Dependencies
Maintainers
5
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-htmlbars-inline-precompile - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

74

__tests__/tests.js

@@ -51,2 +51,76 @@ 'use strict';

it('passes through isProduction option when used as a call expression', function () {
let source = 'hello';
plugins = [
[
HTMLBarsInlinePrecompile,
{
precompile() {
return precompile.apply(this, arguments);
},
isProduction: true,
},
],
];
transform(`import hbs from 'htmlbars-inline-precompile';\nvar compiled = hbs('${source}');`);
expect(optionsReceived).toEqual({
contents: source,
isProduction: true,
});
});
it('uses the user provided isProduction option if present', function () {
let source = 'hello';
plugins = [
[
HTMLBarsInlinePrecompile,
{
precompile() {
return precompile.apply(this, arguments);
},
isProduction: false,
},
],
];
transform(
`import hbs from 'htmlbars-inline-precompile';\nvar compiled = hbs('${source}', { isProduction: true });`
);
expect(optionsReceived).toEqual({
contents: source,
isProduction: true,
});
});
it('passes through isProduction option when used as a TaggedTemplateExpression', function () {
let source = 'hello';
plugins = [
[
HTMLBarsInlinePrecompile,
{
precompile() {
return precompile.apply(this, arguments);
},
isProduction: true,
},
],
];
transform(`import hbs from 'htmlbars-inline-precompile';\nvar compiled = hbs\`${source}\`;`);
expect(optionsReceived).toEqual({
contents: source,
isProduction: true,
});
});
it('allows static userland options when used as a call expression', function() {

@@ -53,0 +127,0 @@ let source = 'hello';

2

CHANGELOG.md

@@ -0,1 +1,3 @@

* Adds `isProduction` option and pass through to `ember-template-compiler` (4619772)
## v3.1.0 (2020-05-06)

@@ -2,0 +4,0 @@

@@ -194,3 +194,5 @@ 'use strict';

path.replaceWith(compileTemplate(state.opts.precompile, template));
let { precompile, isProduction } = state.opts;
path.replaceWith(compileTemplate(precompile, template, { isProduction }));
},

@@ -223,2 +225,3 @@

case 1:
options = {};
break;

@@ -243,4 +246,9 @@ case 2: {

let { precompile } = state.opts;
let { precompile, isProduction } = state.opts;
// allow the user specified value to "win" over ours
if (!('isProduction' in options)) {
options.isProduction = isProduction;
}
path.replaceWith(compileTemplate(precompile, template.value, options));

@@ -247,0 +255,0 @@ },

2

package.json
{
"name": "babel-plugin-htmlbars-inline-precompile",
"version": "3.1.0",
"version": "3.2.0",
"description": "Babel plugin to replace tagged template strings with precompiled HTMLBars templates",

@@ -5,0 +5,0 @@ "repository": "https://github.com/ember-cli/babel-plugin-htmlbars-inline-precompile",

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