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

abatar

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abatar - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

8

experiment_index.js

@@ -5,3 +5,3 @@ var util = require('./util')

this.experimentsByName = {}
this.experimentsByVariable = {}
this.experimentsByVariable = {}
this.activeSubjectKeys = {}

@@ -72,6 +72,8 @@ }

ExperimentIndex.prototype.getFirstMatch = function (variable, subject, now) {
var self = this
return this.getLive(variable, now).filter(
function (x) {
return this.activeSubjectKeys[x.key(subject)]
}.bind(this)
return self.activeSubjectKeys[x.key(subject)]
}
)[0]

@@ -78,0 +80,0 @@ }

{
"name": "abatar",
"version": "0.4.0",
"version": "0.4.1",
"description": "A/B testing minion",

@@ -14,3 +14,4 @@ "main": "index.js",

"author": "Danny Coates",
"license": "MPL 2.0",
"license": "MPL-2.0",
"repository": "dannycoates/abatar",
"dependencies": {

@@ -23,4 +24,4 @@ "js-sha1": "0.2.0"

"tape": "4.0.0",
"zuul": "2.1.1"
"zuul": "3.3.0"
}
}

@@ -283,1 +283,31 @@ var test = require('tape')

)
test(
'getFirstMatch returns first match',
function (t) {
var x1 = new Experiment(
{
name: 'foo',
startDate: '2014-06-01',
independentVariables: ['bar'],
groupingFunction: function () { return { bar: 'x' }}
}
)
x1.active = true
var x2 = new Experiment(
{
name: 'baz',
startDate: '2014-06-01',
independentVariables: ['boaz'],
groupingFunction: function () { return { boaz: 'x' }}
}
)
x2.active = true
now = Date.parse('2015-01-01')
var index = new ExperimentIndex()
index.add(x1, '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33').add(x2, '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a34')
t.equal(index.getFirstMatch('zar', {}, now), undefined, 'no releases')
t.notEqual(index.getFirstMatch('bar', {}, now), undefined, 'no releases')
t.end()
}
)

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