Socket
Socket
Sign inDemoInstall

beard

Package Overview
Dependencies
1
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.5.1 to 0.5.2

14

beard.js

@@ -13,2 +13,4 @@ const fs = require('fs');

const cleanWhitespace = str => str.replace(/\s+/g, ' ').trim();
module.exports = function(opts = {}) {

@@ -27,3 +29,4 @@ opts.cache = opts.cache != undefined ? opts.cache : true;

const key = path.replace(regex, '');
opts.templates[key] = fs.readFileSync(path, 'utf8');
const body = fs.readFileSync(path, 'utf8');
opts.templates[key] = opts.cache ? cleanWhitespace(body) : body;
pathMap[key] = path;

@@ -121,3 +124,3 @@ });

: fs.readFileSync(pathMap[fullPath], 'utf8');
let key = hash(str);
const key = hash(fullPath);

@@ -143,6 +146,3 @@ if (!fnCache[key]) {

.replace(new RegExp('\\\\', 'g'), '\\\\').replace(/"/g, '\\"')
.replace(exps.statement, parser)
.replace(/\n/g, '\\n')
.replace(/\t/g, '\\t')
.replace(/\r/g, '\\r');
.replace(exps.statement, parser);

@@ -194,3 +194,3 @@ const fn = `

try {
eval(fn);
eval(cleanWhitespace(fn));
return _compiledFn.bind(_compiledFn);

@@ -197,0 +197,0 @@ } catch (e) {

{
"name": "beard",
"version": "0.5.1",
"version": "0.5.2",
"description": "More than a mustache.",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc