Huge News!Announcing our $40M Series B led by Abstract Ventures.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.2.2 to 1.3.0

19

compiler.js

@@ -154,2 +154,21 @@ "use strict";

}
},
code: function(node, context) {
return {
content: new OutputBuffer(),
scope: context.scope,
parent: context,
done: function() {
this.parent.content.addCode(node.code.trimLeft() + "\n");
if(this.content.parts.length !== 0) {
this.parent.content.addCode("{");
this.parent.content.addBuffer(this.content);
this.parent.content.addCode("}\n");
} else {
this.parent.content.addCode(";");
this.parent.content.addBuffer(this.content);
}
}
};
}

@@ -156,0 +175,0 @@ };

2

package.json
{
"name": "razorleaf",
"version": "1.2.2",
"version": "1.3.0",
"main": "razorleaf.js",

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

@@ -121,2 +121,15 @@ "use strict";

if(c === "%") {
this.context = {
type: "code",
code: "",
parent: this.context,
indent: this.indent,
children: [],
unexpected: this.error("Code here is not valid")
};
this.context.parent.children.push(this.context);
return states.code;
}
if(c === "\"") {

@@ -162,2 +175,12 @@ this.context = {

},
code: function(c) {
if(c === "\n") {
this.indent = 0;
return states.indent;
}
this.context.code += c;
return states.code;
},
comment: function(c) {

@@ -164,0 +187,0 @@ if(c === "\n") {

@@ -122,2 +122,24 @@ [![Build Status](https://travis-ci.org/campersander/razorleaf.png)](https://travis-ci.org/campersander/razorleaf)

### Code
Code blocks begin with `%` and continue to the end of the line.
Code blocks may contain content (strings, elements, other code blocks,
and special blocks, but not attributes); if they do, they are treated as blocks
and wrapped in curly braces.
For example, this template:
```
% if(i < 5)
!"#{i}"
```
might compile to this JavaScript:
```javascript
if(i < 5) {
__output += i;
}
```
### Special blocks

@@ -124,0 +146,0 @@

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