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

cloudflare-esi

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudflare-esi - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

20

dist/processConditionals.js

@@ -126,2 +126,16 @@ import { tagParser } from "./tagParser";

/**
* Converts a string to a number if it is
* passes that to the tester and returns the result
*
* @param {string} str conditional string to split
* @returns {string | number} condition result
*/
function strToNumOrStr(str) {
// we have to check varInTag is *actually* a number and doesn't just have leading numbers in it
if (strIsNumber(str)) {
return parseInt(str, 10);
}
return str;
}
/**
* Takes a condition string and splits it into its two sides and operator

@@ -146,5 +160,5 @@ * passes that to the tester and returns the result

}
const left = tokensSplit[1] || tokensSplit[2];
const left = strToNumOrStr(tokensSplit[1] || tokensSplit[2]);
const op = op_replacements[tokensSplit[3]] || tokensSplit[3];
const right = tokensSplit[4] || tokensSplit[5];
const right = strToNumOrStr(tokensSplit[4] || tokensSplit[5]);
return esiConditionTester(left, right, op);

@@ -177,2 +191,4 @@ }

case "=~": {
left = left.toString();
right = right.toString();
const regex = right.match(regexExtractor);

@@ -179,0 +195,0 @@ if (!regex)

2

package.json
{
"name": "cloudflare-esi",
"version": "0.2.4",
"version": "0.2.5",
"repository": "cdloh/cloudflare-esi",

@@ -5,0 +5,0 @@ "description": "ESI Parser built to run in Cloudflare workers",

Sorry, the diff of this file is not supported yet

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