Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

twig-layout

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twig-layout - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

13

block.js

@@ -73,4 +73,4 @@ /*!

*/
this.data = {}
this.data = options.data ? options.data : {}
//bind block in data

@@ -248,2 +248,11 @@ this.data.this = this;

/**
* Get parent block instance
*
* @return {Block} Block instance
*/
getParent() {
return this.parent
}
/**
* Render the block

@@ -250,0 +259,0 @@ *

10

layout.js

@@ -271,5 +271,6 @@ /*!

let script = config.script ? config.script : null
let data = config.data ? config.data : null
//load the block
loadBlocks.push(this._loadBlock(config.name, config.template, config, script, parent))
loadBlocks.push(this._loadBlock(config.name, config.template, data, config, script, parent))
}

@@ -293,3 +294,3 @@

*/
async _loadBlock(name, template, config, script, parent) {
async _loadBlock(name, template, data, config, script, parent) {
//check if the block have no name and no template connot load the block

@@ -305,3 +306,3 @@ if (!name && !template) {

//create block
block = await this.createBlock({ name: name, template: template, config: config, script: script, parent: parent })
block = await this.createBlock({ name, template, data, config, script, parent })
} catch (error) {

@@ -388,2 +389,3 @@ const params = {}

parent: options.parent,
data: options.data,
template: options.template || null,

@@ -435,3 +437,3 @@ cache: this._cache

if (childrenBlock && childrenBlock.length) {
await this._loadBlocks(childrenBlock, block.name)
await this._loadBlocks(childrenBlock, block)
}

@@ -438,0 +440,0 @@

@@ -14,3 +14,3 @@ {

"string-hash": "^1.1.3",
"twig": "^1.13.2"
"twig": "^1.13.3"
},

@@ -45,3 +45,3 @@ "description": "A layout system build on top of twig js",

},
"version": "0.1.4"
"version": "0.1.5"
}

@@ -5,2 +5,4 @@ ## express-twig-layout

[documentation](https://metaisfabien.github.io/node-twig-layout/)
## Instalation

@@ -74,3 +76,4 @@

## /views/page/default.html
The template for the page
The template for the page.
For the template syntax read the twig js [documentation](https://github.com/twigjs/twig.js/wiki)

@@ -77,0 +80,0 @@ ```html

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