New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

razorleaf

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

razorleaf - npm Package Compare versions

Comparing version 1.4.2 to 1.5.0

1

cli.js

@@ -27,3 +27,2 @@ #!/usr/bin/env node

var template = razorleaf.compile(content, {
debug: true,
include: function(name) {

@@ -30,0 +29,0 @@ return fs.readFileSync(path.join(directory, name + ".leaf"), "utf8");

26

compiler.js

@@ -144,3 +144,3 @@ "use strict";

function compile(tree, options) {
function compile(tree) {
var context = {

@@ -156,14 +156,10 @@ content: new utilities.CodeContext(),

var code =
var compiled = new Function(
"__util, data",
context.scope.code +
"\n__output = '';\n" +
context.content.code +
"\nreturn __output;";
"\nreturn __output;"
);
if(options.debug) {
console.log(code);
}
var compiled = new Function("__util, data", code);
return function(data) {

@@ -215,7 +211,9 @@ return compiled(utilities, data);

node.else = {
type: "if",
condition: node.elif[0].condition,
children: node.elif[0].children,
elif: node.elif.slice(1),
else: node.else
children: [{
type: "if",
condition: node.elif[0].condition,
children: node.elif[0].children,
elif: node.elif.slice(1),
else: node.else
}]
};

@@ -222,0 +220,0 @@ }

{
"name": "razorleaf",
"version": "1.4.2",
"version": "1.5.0",
"main": "razorleaf.js",

@@ -5,0 +5,0 @@ "files": [

@@ -79,7 +79,6 @@ "use strict";

options = options || {};
tree = loadExtends(tree, [], options);
loadIncludes(tree, [], options);
return compiler.compile(tree, options);
return compiler.compile(tree);
}

@@ -86,0 +85,0 @@

@@ -150,3 +150,4 @@ [![Build Status](https://travis-ci.org/campersander/razorleaf.png)](https://travis-ci.org/campersander/razorleaf)

- **`if (condition)`**: Includes its content only if *`condition`* is met.
- **`else`**: Can immediately follow an `if`.
- **`elif (condition)`**: Can immediately follow an `if` or an `elif`.
- **`else`**: Can immediately follow an `if` or an `elif`.
- **`for (identifier) in (collection)`**: Includes its content for each element

@@ -153,0 +154,0 @@ in the array or array-like object *`collection`*.

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