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.0.2 to 2.1.0

6

CHANGELOG.md

@@ -11,2 +11,8 @@ Changelog

## [2.1.0] - 2021-12-20
### Added
- Support `$string_split`
- Support named `item` variable in foreach
## [2.0.2] - 2021-12-20

@@ -13,0 +19,0 @@

4

lib/ESIEvaluator.js

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

}
context.itemVariableName = data.item || "item";

@@ -184,4 +185,5 @@ context.foreachChunks = [];

if (Array.isArray(value)) value = `[${value.map((v) => typeof v === "string" ? `'${v}'` : v).join(",")}]`;
buffered = buffered.concat([ {
name: "esi:assign", data: { name: "item", value: value.toString() },
name: "esi:assign", data: { name: context.itemVariableName, value: value.toString() },
}, { name: "esi:assign" } ], foreachChunks);

@@ -188,0 +190,0 @@ }

@@ -72,2 +72,10 @@ /* eslint-disable camelcase */

}
string_split([ arg1, arg2 ]) {
const stringToSplit = this.execute(arg1.type, arg1);
const splitBy = this.execute(arg2.type, arg2);
if (typeof stringToSplit !== "string" || typeof splitBy !== "string") {
throw new Error("string_split requires two arguments of type string");
}
return stringToSplit.split(splitBy);
}
substr([ arg1, arg2, arg3 ]) {

@@ -74,0 +82,0 @@ const string = this.execute(arg1.type, arg1);

{
"name": "@bonniernews/local-esi",
"version": "2.0.2",
"version": "2.1.0",
"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