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.4 to 0.1.5

60

doT.js

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

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

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

varname: 'it',
strip : true
strip : true,
append: true
};

@@ -35,10 +36,10 @@

return str.replace(define, function (match, code, value) {
if (!(code in defs)) defs[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;
});
if (!(code in defs)) defs[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;
});
}

@@ -48,22 +49,25 @@

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;
str = ("var out='" +
((c.strip) ? str.replace(/\s*<!\[CDATA\[\s*|\s*\]\]>\s*|[\r\n\t]|(\/\*[\s\S]*?\*\/)/g, ''): str)
.replace(/\\/g, '\\\\')
.replace(/'/g, "\\'")
.replace(c.interpolate, function(match, code) {
return "';out+=" + code.replace(/\\'/g, "'").replace(/\\\\/g,"\\").replace(/[\r\t\n]/g, ' ') + ";out+='";
})
.replace(c.encode, function(match, code) {
return "';out+=(" + 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;');out+='";
})
.replace(c.evaluate, function(match, code) {
return "';" + code.replace(/\\'/g, "'").replace(/\\\\/g,"\\").replace(/[\r\t\n]/g, ' ') + "out+='";
})
+ "';return out;")
.replace(/\n/g, '\\n')
.replace(/\t/g, '\\t')
.replace(/\r/g, '\\r')
.split("out+='';").join('')
.split('var out="";out+=').join('var out=');
((c.strip) ? str.replace(/\s*<!\[CDATA\[\s*|\s*\]\]>\s*|[\r\n\t]|(\/\*[\s\S]*?\*\/)/g, ''): str)
.replace(/\\/g, '\\\\')
.replace(/'/g, "\\'")
.replace(c.interpolate, function(match, code) {
return cstart + code.replace(/\\'/g, "'").replace(/\\\\/g,"\\").replace(/[\r\t\n]/g, ' ') + cend;
})
.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;
})
.replace(c.evaluate, function(match, code) {
return "';" + code.replace(/\\'/g, "'").replace(/\\\\/g,"\\").replace(/[\r\t\n]/g, ' ') + "out+='";
})
+ "';return out;")
.replace(/\n/g, '\\n')
.replace(/\t/g, '\\t')
.replace(/\r/g, '\\r')
.split("out+='';").join('')
.split("var out='';out+=").join('var out=');

@@ -70,0 +74,0 @@ try {

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

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

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

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