New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-ab-decider

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-ab-decider - npm Package Compare versions

Comparing version 0.0.12 to 0.0.13

7

index.js

@@ -7,2 +7,3 @@ const proxy = require("express-http-proxy");

const hash = random(10000, 99999);
const HASH_SPLITTER = "@"

@@ -72,4 +73,4 @@ const decider = (exps, choosen, forceReturn) => {

const experimentCookie = req.cookies[cookieName];
const cookieValue = experimentCookie && experimentCookie.split("-")[0];
const cookieHash = experimentCookie && experimentCookie.split("-")[1];
const cookieValue = experimentCookie && experimentCookie.split(HASH_SPLITTER)[0];
const cookieHash = experimentCookie && experimentCookie.split(HASH_SPLITTER)[1];
const existingExperience = hash == cookieHash && experiences[cookieValue];

@@ -80,3 +81,3 @@ const x = existingExperience || decider(experiences, cookieValue, true);

if (!existingExperience) {
res.cookie(cookieName, `${x.name}-${hash}`, { maxAge });
res.cookie(cookieName, `${x.name}${HASH_SPLITTER}${hash}`, { maxAge });
}

@@ -83,0 +84,0 @@

{
"name": "node-ab-decider",
"version": "0.0.12",
"version": "0.0.13",
"description": "",

@@ -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