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

jsmartier

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsmartier - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

60

jsmartier.js
/**
* jsmartier
*
*
*/
console.log('jsmartier version 0.1.0');
console.log('jsmartier version 0.1.1');
// modules

@@ -20,2 +19,10 @@ var FS = require('fs');

};
/**
* function jsmartier.config(conf:object):void
*
* Override default configurations of jsmartier
*
* @example jsmartier.config({path:'./views/'});
*/
exports.config = function(conf) {

@@ -27,2 +34,25 @@ for ( var k in conf) {

exports.buildArgs = function(obj) {
var now = Date.now();
var smarty = {
now : now,
get : {
time_stamp : now / 1000 << 0
}
};
obj = Object(obj);
obj.__proto__ = {
smarty : smarty
};
return obj;
};
exports.render = function(path, values) {
values = Object(values);
var conf = {};
conf.__global__ = conf;
return getTemplate(path)(values, conf);
};
// plugins

@@ -61,3 +91,4 @@ parser.plugins.config_load = function(vars, config, args) {

// include: args.file
console.log('// include ' + args._path.substr(0, args._path.lastIndexOf('/') + 1) + args.file, args);
// console.log('// include ' + args._path.substr(0,
// args._path.lastIndexOf('/') + 1) + args.file, args);
args.__proto__ = vars;

@@ -139,24 +170,1 @@ return getTemplate(args.file, args.file.charAt(0) === '.' && args._path.substr(0, args._path.lastIndexOf('/') + 1))(args, {

}
exports.buildArgs = function(req) {
var now = Date.now();
var obj = {
now : now,
get : {
time_stamp : now / 1000 << 0
}
};
return {
__proto__ : {
smarty : obj
}
};
};
exports.render = function(path, values) {
values = Object(values);
var conf = {};
conf.__global__ = conf;
return getTemplate(path)(values, conf);
};

@@ -5,3 +5,3 @@ {

"main": "jsmartier.js",
"version": "0.1.0",
"version": "0.1.1",
"scripts": {

@@ -8,0 +8,0 @@ "test": "echo \"Error: no test specified\" && exit 1"

@@ -94,4 +94,3 @@ var stringify = JSON.stringify;

function parse(text, path, prefix, suffix) {
var buf = 'var _path=' + stringify(path)
+ ';return function(vars,config){console.log("invoke",_path,vars,config);return ""';
var buf = 'var _path=' + stringify(path) + ';return function(vars,config){return ""';
var stack = [];

@@ -127,3 +126,3 @@ while (text) {

buf = buf.replace(/"\+"/g, '').replace(/\+""\+/g, '+');
console.log('function anonymous($){' + buf + '}');
// console.log('function anonymous($){' + buf + '}');
return buf;

@@ -211,3 +210,3 @@

content = content.replace(/#(\w+)#/g, 'config.$1').replace(/\$/g, 'vars.').replace(/->/g, '.');
console.log('--> expanding ' + content);
// console.log('--> expanding ' + content);
do {

@@ -232,4 +231,4 @@ oldLen = content.length;

} while (content.length != oldLen);
console.log('<-- expanded ' + content);
// console.log('<-- expanded ' + content);
return content;
}
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