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

dot

Package Overview
Dependencies
Maintainers
0
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dot - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

33

doT.js

@@ -13,3 +13,3 @@ // doT.js

(function() {
var doT = { version : '0.1.5' };
var doT = { version : '0.1.6' };

@@ -27,3 +27,3 @@ if (typeof module !== 'undefined' && module.exports) {

use: /\{\{#([\s\S]+?)\}\}/g, //compile time evaluation
define: /\{\{#\s*([\w$]+)\s*\:([\s\S]+?)#\}\}/g, //compile time defs
define: /\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g, //compile time defs
varname: 'it',

@@ -34,19 +34,28 @@ strip : true,

function resolveDefs(define, use, str, defs) {
return str.replace(define, function (match, code, value) {
if (!(code in defs)) defs[code]=value;
function resolveDefs(c, block, def) {
return ((typeof block === 'string') ? block : block.toString())
.replace(c.define, function (match, code, assign, value) {
if (code.indexOf('def.') === 0) {
code = code.substring(4);
}
if (!(code in def)) {
if (assign === ':') {
def[code]= value;
} else {
eval("def[code]=" + value);
}
}
return '';
})
.replace(use, function(match, code) {
var value; // todo: detect circular use and convert into compiled functions
with(defs) {try { value = eval(code);} catch(e) { value='';} }
return value ? resolveDefs(define, use, value.toString(), defs) : value;
.replace(c.use, function(match, code) {
var v = eval(code);
return v ? resolveDefs(c, v, def) : v;
});
}
doT.template = function(tmpl, c, defs) {
doT.template = function(tmpl, c, def) {
c = c || doT.templateSettings;
var cstart = c.append ? "'+(" : "';out+=(", // optimal choice depends on platform/size of templates
cend = c.append ? ")+'" : ");out+='";
var str = (c.use || c.define) ? resolveDefs(c.define, c.use, tmpl, defs || {}) : tmpl;
var str = (c.use || c.define) ? resolveDefs(c, tmpl, def || {}) : tmpl;

@@ -61,3 +70,3 @@ str = ("var out='" +

.replace(c.encode, function(match, code) {
return cstart + code.replace(/\\'/g, "'").replace(/\\\\/g, "\\").replace(/[\r\t\n]/g, ' ') + ").toString().replace(/&(?!\\w+;)/g, '&#38;').split('<').join('&#60;').split('>').join('&#62;').split('" + '"' + "').join('&#34;').split(" + '"' + "'" + '"' + ").join('&#39;').split('/').join('&#x2F;'" + cend;
return cstart + code.replace(/\\'/g, "'").replace(/\\\\/g, "\\").replace(/[\r\t\n]/g, ' ') + ").toString().replace(/&(?!\\w+;)/g, '&#38;').split('<').join('&#60;').split('>').join('&#62;').split('" + '"' + "').join('&#34;').split(" + '"' + "'" + '"' + ").join('&#39;').split('/').join('&#47;'" + cend;
})

@@ -64,0 +73,0 @@ .replace(c.evaluate, function(match, code) {

@@ -10,3 +10,3 @@ {

],
"version": "0.1.5",
"version": "0.1.6",
"main": "doT",

@@ -13,0 +13,0 @@ "homepage": "http://github.com/olado/doT",

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