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

@bonniernews/local-esi

Package Overview
Dependencies
Maintainers
8
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 2.0.0 to 2.0.1

5

CHANGELOG.md

@@ -11,2 +11,7 @@ Changelog

## [2.0.1] - 2021-12-17
### Fixed
- Removed fallthrough behaviour of overlapping whens
## [2.0.0] - 2021-12-09

@@ -13,0 +18,0 @@

21

lib/ESIEvaluator.js

@@ -41,3 +41,3 @@ /* eslint-disable no-use-before-define */

open(data, next) {
this.context.chooses.push({ hasEvaluatedToTrue: false, isCurrentlyEvaluatedTo: false });
this.context.chooses.push({ testMatched: false, chosen: false });
return next();

@@ -55,3 +55,15 @@ }

const lastChoose = context.chooses[context.chooses.length - 1];
const result = test(data.test, context);
let result;
try {
result = test(data.test, context);
} catch (err) {
return next(err);
}
if (lastChoose.testMatched) {
lastChoose.chosen = false;
return next();
}
if (data.matchname) {

@@ -61,4 +73,3 @@ context.assigns[data.matchname] = result;

lastChoose.isCurrentlyEvaluatedTo = !lastChoose.isCurrentlyEvaluatedTo && result;
lastChoose.hasEvaluatedToTrue = lastChoose.hasEvaluatedToTrue || result;
lastChoose.testMatched = lastChoose.chosen = !!result;

@@ -73,3 +84,3 @@ return next();

const lastChoose = context.chooses[context.chooses.length - 1];
lastChoose.isCurrentlyEvaluatedTo = !lastChoose.hasEvaluatedToTrue;
lastChoose.chosen = !lastChoose.testMatched;
return next();

@@ -76,0 +87,0 @@ }

@@ -50,3 +50,3 @@ "use strict";

if (this.chooses.length) {
return this.chooses.every((choose) => choose.isCurrentlyEvaluatedTo);
return this.chooses.every((choose) => choose.chosen);
}

@@ -53,0 +53,0 @@

{
"name": "@bonniernews/local-esi",
"version": "2.0.0",
"version": "2.0.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