Socket
Socket
Sign inDemoInstall

babel-plugin-glimmer-inline-precompile

Package Overview
Dependencies
10
Maintainers
10
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.2.0

3

index.js

@@ -15,3 +15,4 @@ 'use strict';

if (t.isLiteral(node.source, { value: 'glimmer-inline-precompile' })) {
let matchingImportPath = state.opts.importPath || 'glimmer-inline-precompile';
if (t.isLiteral(node.source, { value: matchingImportPath })) {
let first = node.specifiers && node.specifiers[0];

@@ -18,0 +19,0 @@

{
"name": "babel-plugin-glimmer-inline-precompile",
"version": "1.1.0",
"version": "1.2.0",
"description": "Use tagged template strings to precompile glimmer templates inside your JS files.",

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

@@ -22,7 +22,9 @@ 'use strict';

function transform(source) {
function transform(source, _plugins) {
let plugins = _plugins || [
[GlimmerInlinePrecompile, { precompile: input => JSON.stringify(input.toUpperCase()) }],
];
let result = babel.transform(source, {
plugins: [
[GlimmerInlinePrecompile, { precompile: input => JSON.stringify(input.toUpperCase()) }],
],
plugins,
});

@@ -65,2 +67,10 @@

});
QUnit.test('allows configuring import path to replace', assert => {
let actual = transform(`import hbs from 'herpy/derpy/doo'; let template = hbs\`{{hello}}\`;`, [
[GlimmerInlinePrecompile, { importPath: 'herpy/derpy/doo', precompile: input => JSON.stringify(input.toUpperCase()) }],
]);
assert.equal(actual, `let template = "{{HELLO}}";`);
});
});

@@ -67,0 +77,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc