babel-plugin-htmlbars-inline-precompile
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -54,3 +54,5 @@ 'use strict'; | ||
transform( | ||
`import hbs from 'htmlbars-inline-precompile';\nvar compiled = hbs('${source}', { parseOptions: { srcName: 'bar.hbs' }, moduleName: 'foo/bar.hbs', xyz: 123, qux: true });` | ||
`import hbs from 'htmlbars-inline-precompile';\nvar compiled = hbs('${source}', { parseOptions: { srcName: 'bar.hbs' }, moduleName: 'foo/bar.hbs', xyz: 123, qux: true, stringifiedThing: ${JSON.stringify( | ||
{ foo: 'baz' } | ||
)}});` | ||
); | ||
@@ -64,2 +66,5 @@ | ||
qux: true, | ||
stringifiedThing: { | ||
foo: 'baz', | ||
}, | ||
}); | ||
@@ -66,0 +71,0 @@ }); |
@@ -0,1 +1,9 @@ | ||
## v2.1.1 (2019-09-29) | ||
#### :bug: Bug Fix | ||
* [#104](https://github.com/ember-cli/babel-plugin-htmlbars-inline-precompile/pull/104) Ensure JSON.stringify'ed value is valid for hbs() options. ([@rwjblue](https://github.com/rwjblue)) | ||
#### Committers: 1 | ||
- Robert Jackson ([@rwjblue](https://github.com/rwjblue)) | ||
## v2.1.0 (2019-09-09) | ||
@@ -2,0 +10,0 @@ |
@@ -73,9 +73,12 @@ 'use strict'; | ||
node.properties.forEach(property => { | ||
if (property.computed || property.key.type !== 'Identifier') { | ||
if (property.computed || !['Identifier', 'StringLiteral'].includes(property.key.type)) { | ||
throw buildError('hbs can only accept static options'); | ||
} | ||
let propertyName = | ||
property.key.type === 'Identifier' ? property.key.name : property.key.value; | ||
let value = parseExpression(buildError, property.value); | ||
result[property.key.name] = value; | ||
result[propertyName] = value; | ||
}); | ||
@@ -82,0 +85,0 @@ |
{ | ||
"name": "babel-plugin-htmlbars-inline-precompile", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Babel plugin to replace tagged template strings with precompiled HTMLBars templates", | ||
@@ -18,14 +18,14 @@ "repository": "https://github.com/ember-cli/babel-plugin-htmlbars-inline-precompile", | ||
"devDependencies": { | ||
"@babel/core": "^7.5.5", | ||
"@babel/core": "^7.6.2", | ||
"@babel/plugin-transform-modules-amd": "^7.5.0", | ||
"@babel/plugin-transform-template-literals": "^7.4.4", | ||
"common-tags": "^1.8.0", | ||
"ember-source": "^3.12.0", | ||
"eslint": "^6.3.0", | ||
"eslint-config-prettier": "^6.2.0", | ||
"ember-source": "^3.13.2", | ||
"eslint": "^6.4.0", | ||
"eslint-config-prettier": "^6.3.0", | ||
"eslint-plugin-node": "^10.0.0", | ||
"eslint-plugin-prettier": "^3.1.0", | ||
"eslint-plugin-prettier": "^3.1.1", | ||
"jest": "^24.9.0", | ||
"prettier": "^1.18.2", | ||
"release-it": "^12.2.1", | ||
"release-it": "^12.4.1", | ||
"release-it-lerna-changelog": "^1.0.3" | ||
@@ -32,0 +32,0 @@ }, |
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
36147
468