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

ltl

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ltl - npm Package Compare versions

Comparing version 0.1.12 to 0.1.13

28

ltl.js

@@ -71,3 +71,3 @@ /**

// Allow users to see what version of ltl they're using.
version: '0.1.12',
version: '0.1.13',

@@ -150,3 +150,4 @@ // Store all of the templates that have been compiled.

var varIndex = 0;
var escapeVar = false;
var escapeHtmlVar = false;
var encodeUriVar = false;
var loopVars = [];

@@ -383,6 +384,6 @@

/**
* Find ${...} and ={...} and turn them into contextified insertions unless escaped.
* Find ${...}, &{...} and ={...} and turn them into contextified insertions unless escaped.
*/
function interpolate(code) {
return code.replace(/(\\?)([$=])\{([^\}]+)\}/g, function(match, backslash, symbol, expression) {
return code.replace(/(\\?)([$=&])\{([^\}]+)\}/g, function(match, backslash, symbol, expression) {
if (backslash) {

@@ -392,7 +393,13 @@ return symbol + '{' + expression + '}';

if (symbol == '$') {
if (!escapeVar) {
escapeVar = vars[varIndex++];
if (!escapeHtmlVar) {
escapeHtmlVar = vars[varIndex++];
}
return "'+" + escapeVar + '(' + contextify(expression) + ")+'";
return "'+" + escapeHtmlVar + '(' + contextify(expression) + ")+'";
}
else if (symbol == '&') {
if (!encodeUriVar) {
encodeUriVar = vars[varIndex++];
}
return "'+" + encodeUriVar + '(' + contextify(expression) + ")+'";
}
else {

@@ -703,5 +710,8 @@ return "'+" + contextify(expression) + "+'";

// Create the function.
if (escapeVar) {
output = "function " + escapeVar + "(t){return (t==null?'':''+t).replace(/</g,'&lt;')};" + output;
if (escapeHtmlVar) {
output = "function " + escapeHtmlVar + "(t){return (t==null?'':''+t).replace(/</g,'&lt;')};" + output;
}
if (encodeUriVar) {
output = "function " + encodeUriVar + "(t){return (encodeURIComponent||escape)(t==null?'':''+t)};" + output;
}
output = 'function(' + settings.contextVar + (hasGets ? ',' + settings.partsVar : '') + '){' + output + '}';

@@ -708,0 +718,0 @@

@@ -14,3 +14,3 @@ {

],
"version": "0.1.12",
"version": "0.1.13",
"main": "ltl",

@@ -17,0 +17,0 @@ "homepage": "http://lighter.io/ltl",

@@ -199,3 +199,13 @@ # Ltl

If you'd like your content to skip HTML encoding (because
To encode for a URL rather than HTML, use `&{}`.
Context: `{query: "good brewpubs"}`
```jade
a(href="?q=&{query}")
```
```html
<a href="?q=good%20brewpubs">good brewpubs</a>
```
If you'd like your content to skip encoding (because
you want your expression to output raw HTML tags rather

@@ -212,3 +222,3 @@ than safely escaped text), use `={..}`.

If you want to show `${..}` or `={..}` blocks in your output,
If you want to show `${..}`, `&{..}` or `={..}` blocks in your output,
you can escape with a backslash.

@@ -215,0 +225,0 @@ ```jade

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