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 0.1.0 to 0.1.1

12

index.js

@@ -0,4 +1,14 @@

var crypto = require('crypto');
module.exports = function(precompile, _options) {
var options = _options || {};
var cacheKey = options.cacheKey;
// cacheKey can be very large; do not retain it
options = _options = null;
if (typeof cacheKey === 'string') {
cacheKey = crypto.createHash('md5').update(cacheKey).digest('hex');
}
function htmlbarsInlineCompilerPlugin(babel) {

@@ -90,3 +100,3 @@ var t = babel.types;

htmlbarsInlineCompilerPlugin.cacheKey = function() {
return options.cacheKey;
return cacheKey;
};

@@ -93,0 +103,0 @@

2

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

@@ -5,0 +5,0 @@ "scripts": {

@@ -6,2 +6,3 @@ var assert = require('assert');

var HTMLBarsInlinePrecompile = require('../index');
var crypto = require('crypto');

@@ -65,6 +66,8 @@ var transform;

describe('caching', function() {
it('passes through second argument as `cacheKey`', function() {
it('captures an md4 hash of the `cacheKey` in its second arg', function() {
var plugin = HTMLBarsInlinePrecompile(function() {}, { cacheKey: 'asdfasdf' });
assert.equal(plugin.cacheKey(), 'asdfasdf');
var digest = crypto.createHash('md5').update('asdfasdf').digest("hex");
assert.equal(plugin.cacheKey(), digest);
});

@@ -71,0 +74,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc