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

@bonniernews/local-esi

Package Overview
Dependencies
Maintainers
6
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bonniernews/local-esi - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

1

lib/evaluateExpression.js

@@ -13,2 +13,3 @@ "use strict";

function assign(value, context) {
if (value === "true" || value === "false") return value;
return evaluate(parse(value), context);

@@ -15,0 +16,0 @@ }

26

lib/expression/evaluate.js

@@ -103,8 +103,8 @@ /* eslint-disable camelcase */

if (node.operator === "==") return left === right;
if (node.operator === "!=") return left !== right;
if (node.operator === ">=") return left >= right;
if (node.operator === "<=") return left <= right;
if (node.operator === "<") return left < right;
if (node.operator === ">") return left > right;
if (node.operator === "==") return left === castRight(left, right);
if (node.operator === "!=") return left !== castRight(left, right);
if (node.operator === ">=") return left >= castRight(left, right);
if (node.operator === "<=") return left <= castRight(left, right);
if (node.operator === "<") return left < castRight(left, right);
if (node.operator === ">") return left > castRight(left, right);
if (node.operator === "+") return left + right;

@@ -189,1 +189,15 @@ if (node.operator === "-") return left - right;

};
function castRight(left, right) {
switch (typeof left) {
case "string":
return `${right}`;
case "boolean":
if (right === "false") return false;
if (right === "true") return true;
break;
case "number":
return Number(right);
}
return right;
}

@@ -25,2 +25,3 @@ /* eslint-disable prefer-template */

BLOCK,
BOOLEAN,
ENDMARK,

@@ -224,2 +225,12 @@ FUNCTION,

if (token.cargo === "true") {
token.type = BOOLEAN;
return next();
}
if (token.cargo === "false") {
token.type = BOOLEAN;
return next();
}
if (keywords.indexOf(token.cargo) === -1) {

@@ -291,2 +302,8 @@ token.abort("Unknown keyword", token.cargo);

}
case BOOLEAN: {
return {
type: LITERAL,
value: this.cargo === "true",
};
}
case IDENTIFIER: {

@@ -293,0 +310,0 @@ return {

@@ -7,2 +7,3 @@ "use strict";

BLOCK: "BlockStatement",
BOOLEAN: "Boolean",
ENDMARK: "EOL",

@@ -9,0 +10,0 @@ EXPRESSION: "Expression",

{
"name": "@bonniernews/local-esi",
"version": "1.1.0",
"version": "1.1.1",
"description": "Local Edge Side Includes parser",

@@ -5,0 +5,0 @@ "main": "index.js",

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