scientist
Version:
Carefully refactor critical paths in production
28 lines (22 loc) • 698 B
JavaScript
var Result, _;
_ = require('underscore');
Result = (function() {
function Result(experiment, control, candidates) {
var comparable;
this.experiment = experiment;
this.context = experiment.context();
this.control = control;
this.candidates = candidates;
this.ignored = _.select(candidates, function(candidate) {
return control.ignores(candidate);
});
comparable = _.difference(candidates, this.ignored);
this.matched = _.select(comparable, function(candidate) {
return control.matches(candidate);
});
this.mismatched = _.difference(comparable, this.matched);
Object.freeze(this);
}
return Result;
})();
module.exports = Result;