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

tarkine

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tarkine - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

16

package.json
{
"name": "tarkine",
"version": "0.0.2",
"version": "0.0.3",
"description": "tarkine - A powerful and flexible template engine for Node.js applications.",
"main": "src/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/madhanmaaz/tarkine.git"
},
"author": {
"name": "madhanmaaz",
"url": "http://madhanmaaz.netlify.app/"
},
"files": [

@@ -24,7 +32,3 @@ "src/",

],
"author": {
"name": "madhanmaaz",
"url": "http://madhanmaaz.netlify.app/"
},
"license": "ISC"
}
}

@@ -93,11 +93,2 @@ <p align="center">

- Blocks
```js
{{define blockName(param1, param2) }}
// block content
{{/}}
{{ blockName(arg1, arg2) }}
```
- Code Execution

@@ -104,0 +95,0 @@ ```js

@@ -5,40 +5,13 @@ const helpers = require("./helpers")

const delimiterPattern = helpers.escapeRegExp(helpers.openDelimiter) +
"\\s*([~#-=/]|define\\s*|for\\s*\\(|if\\s*\\(|else)?\\s*([\\s\\S]*?)\\s*" +
"\\s*([~#-=/]|for\\s*\\(|if\\s*\\(|else)?\\s*([\\s\\S]*?)\\s*" +
helpers.escapeRegExp(helpers.closeDelimiter)
const timeStore = {
ifStart: false,
forStart: false,
defineStart: false,
resetStore() {
this.ifStart = false
this.forStart = false
this.defineStart = false
}
}
function handleDirective(type, content) {
switch (type) {
case '/': {// close brackets
if (timeStore.ifStart || timeStore.forStart) {
timeStore.ifStart = false
timeStore.forStart = false
return "}\n;"
}
case '/':
return "}\n;"
if (timeStore.defineStart) {
timeStore.defineStart = false
return "return function __includeRenderer__() {return __out;};}\n;"
}
}
// define block
case "define":
timeStore.defineStart = true
return `function ${content} {\nlet __out ='';\n`
// loops
case "for (":
case "for(": {
timeStore.forStart = true
const [variables, data] = content.slice(0, -1).split(" in ")

@@ -53,6 +26,4 @@ const [key, value] = variables.split(",")

case "if (":
timeStore.ifStart = true
return `if(${content}{\n`
case "else":
timeStore.ifStart = true
return content.startsWith("if") ? `} else ${content}{\n` : "} else {\n"

@@ -120,3 +91,2 @@

const errorStore = { line: 0 }
timeStore.resetStore()

@@ -123,0 +93,0 @@ try {

Sorry, the diff of this file is not supported yet

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