render.javascript
Advanced tools
Comparing version 0.1.1 to 0.1.2
{ | ||
"description": "Render.js | Template Engine for Express", | ||
"keywords": [ | ||
"render", | ||
"js", | ||
"javascript", | ||
"template", | ||
"engine", | ||
"express", | ||
"nodejs" | ||
"render", | ||
"js", | ||
"javascript", | ||
"template", | ||
"engine", | ||
"express", | ||
"nodejs" | ||
], | ||
"authors": [ | ||
{ "name": "clqu", "email": "me@clqu.live" }, | ||
{ "name": "Swôth", "email": "me@swoth.xyz" } | ||
{ | ||
"name": "clqu", | ||
"email": "me@clqu.live" | ||
}, | ||
{ | ||
"name": "Swôth", | ||
"email": "me@swoth.xyz" | ||
} | ||
], | ||
@@ -19,3 +25,3 @@ "license": "Apache-2.0", | ||
"name": "render.javascript", | ||
"version": "0.1.1" | ||
"version": "0.1.2" | ||
} |
@@ -9,4 +9,4 @@ const version = require('../package.json').version; | ||
let head = "let str = '';with(obj){str+=`", | ||
tail = "`; return str;}"; | ||
tail = "`; return str;}"; | ||
const variable = /\{\{([^}]+)\}\}/g; | ||
@@ -24,4 +24,4 @@ const expression = /\{\%([^%]+)\%\}/g; | ||
'<!-- \n' + | ||
' rendered by render.js@' + version + ' \n' + | ||
' npmjs.com/package/render.js \n' + | ||
' rendered by render.javascript@' + version + ' \n' + | ||
' npmjs.com/package/render.javascript \n' + | ||
'-->' | ||
@@ -31,11 +31,17 @@ ) : '') + fn(Object.assign(data, { | ||
let parts = filePath.split('/'); | ||
let file = parts.slice(0, parts.length - 1).join('/'); | ||
return renderFile(file + '/' + path, data, true); | ||
let $path = parts.join('/') | ||
.split('\\') | ||
.join('//') | ||
.split('//') | ||
.slice(0, -1) | ||
.join('\\'); | ||
return renderFile($path + path?.replace(/\.\//g, '\\')?.replace(/\.\.\//g, '\\'), data, true); | ||
} | ||
})).replace('\r\n', ''); | ||
} catch(parseErr) { | ||
} catch (parseErr) { | ||
parseErr.name = 'Render.js Error'; | ||
const fileContent = fs.readFileSync(filePath).toString(); | ||
console.error(parseErr); | ||
return fs.readFileSync(path.join(__dirname, './error.html')).toString() | ||
@@ -42,0 +48,0 @@ .replace(/{{error}}/g, parseErr.name + ': ' + parseErr.message) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6150
70
2