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

@bonniernews/local-esi

Package Overview
Dependencies
Maintainers
9
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.1.1 to 2.1.2

5

CHANGELOG.md

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

## [2.1.2] - 2022-03-03
### Fixed
- Throw error if esi:choose has other direct children than esi:when and esi:otherwise
## [2.1.1] - 2021-12-20

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

16

lib/ESIEvaluator.js

@@ -40,2 +40,7 @@ /* eslint-disable no-use-before-define */

class ESIChoose extends ESITag {
assert(name) {
if (![ "esi:when", "esi:otherwise" ].includes(name)) {
throw new Error(`${name} is not allowed inside a esi:choose`);
}
}
open(data, next) {

@@ -247,3 +252,12 @@ this.context.chooses.push({ testMatched: false, chosen: false });

if (Tag) esiFunc = new Tag(context);
context.tags.push(esiFunc);
const tags = context.tags;
const idx = context.tags.push(esiFunc);
const parent = tags[idx - 2];
if (parent?.assert) {
try {
parent.assert(name);
} catch (err) {
return next(err);
}
}
if (!wasInPlainText) return esiFunc.open(data, next);

@@ -250,0 +264,0 @@ }

12

package.json
{
"name": "@bonniernews/local-esi",
"version": "2.1.1",
"version": "2.1.2",
"description": "Local Edge Side Includes parser",

@@ -21,10 +21,10 @@ "main": "index.js",

"devDependencies": {
"@bonniernews/atlas-html-stream": "^2.0.0",
"chai": "^4.3.4",
"@bonniernews/atlas-html-stream": "^2.0.1",
"chai": "^4.3.6",
"chronokinesis": "^3.1.2",
"eslint": "^8.5.0",
"eslint": "^8.10.0",
"eslint-config-exp": "0.0.9",
"got": "^11.8.3",
"mocha": "^9.1.3",
"nock": "^13.2.1"
"mocha": "^9.2.1",
"nock": "^13.2.4"
},

@@ -31,0 +31,0 @@ "engines": {

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