Socket
Socket
Sign inDemoInstall

beard

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

beard - npm Package Compare versions

Comparing version 0.5.2 to 0.5.3

40

beard.js

@@ -65,2 +65,3 @@ const fs = require('fs');

encode: (/^\:(.*)/),
comment: (/^\*.*\*$/g),
statement: (/{{\s*([\S\s(?!}})]+?)\s*}}/g),

@@ -81,2 +82,3 @@ if: (/^if\s+([^]*)$/),

encode: (_, statement) => `_encode(${statement});`,
comment: () => '',
if: (_, statement) => `if (${statement}) {`,

@@ -105,2 +107,3 @@ elseIf: (_, statement) => `} else if (${statement}) {`,

.replace(exps.encode, parse.encode)
.replace(exps.comment, parse.comment)
.replace(exps.end, parse.end)

@@ -122,12 +125,11 @@ .replace(exps.else, parse.else)

const fullPath = resolvePath(path, parentPath);
const str = opts.cache
? opts.templates[fullPath]
: fs.readFileSync(pathMap[fullPath], 'utf8');
const key = hash(fullPath);
if (!fnCache[key]) {
fnCache[key] = compile(str, fullPath);
if (opts.cache) {
const str = opts.templates[fullPath];
const key = hash(fullPath);
if (!fnCache[key]) fnCache[key] = compile(str, fullPath);
return fnCache[key];
} else {
const str = fs.readFileSync(pathMap[fullPath], 'utf8');
return compile(str, fullPath);
}
return fnCache[key];
}

@@ -142,3 +144,3 @@

_context.globals.view = _buffer;
_buffer = compiled("${path}", path)(_context);
_buffer = compiled('${path}', path)(_context);
`;

@@ -152,4 +154,4 @@ return '';

function _compiledFn(_context){
var path = "${path}";
var _buffer = "";
var path = '${path}';
var _buffer = '';
var _blockName;

@@ -176,5 +178,15 @@ var _blockCapture;

function exists(varname) {
return eval('typeof ' + varname + ' !== "undefined";');
}
function put(varname) {
return exists(varname)
? eval(varname)
: '';
}
for (var prop in _context.globals) {
if (_context.globals.hasOwnProperty(prop)) {
eval("var " + prop + " = _context.globals[prop]");
eval('var ' + prop + ' = _context.globals[prop]');
}

@@ -186,3 +198,3 @@ }

if (_locals.hasOwnProperty(prop)) {
eval("var " + prop + " = _locals[prop]");
eval('var ' + prop + ' = _locals[prop]');
}

@@ -189,0 +201,0 @@ }

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

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

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