Skip to content

Commit 99212e9

Browse files
JAMES NEIMAN CONSULTINGJAMES NEIMAN CONSULTING
authored andcommitted
edits based on gh feedback
1 parent 7e79308 commit 99212e9

File tree

1 file changed

+7
-7
lines changed
  • packages/optimizely-sdk/lib/core/decision_service

1 file changed

+7
-7
lines changed

packages/optimizely-sdk/lib/core/decision_service/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var DECISION_SOURCES = enums.DECISION_SOURCES;
3636
* The decision service contains all logic determining how a user decision is made. The following tasks are performed in order:
3737
* 1. Check the experiment status.
3838
* 2. Check for forced bucketing.
39-
* 3. Check for whitelisting.
39+
* 3. Check for white listing.
4040
* 4. Check the user profile service for past bucketing decisions (sticky bucketing).
4141
* 5. Check for audience targeting.
4242
* 6. Bucket the user.
@@ -120,7 +120,7 @@ DecisionService.prototype.__resolveExperimentBucketMap = function(userId, attrib
120120

121121

122122
/**
123-
* Checks whether the experiment is running or launched.
123+
* Returns a boolean indicating whether the experiment is running or launched.
124124
* @param {string} experimentKey The ID of the of experiment being validated.
125125
* @param {string} userId The ID of the user.
126126
* @return {boolean} `true` if the experiment is running, `false` if the experiment is not running.
@@ -139,7 +139,7 @@ DecisionService.prototype.__checkIfExperimentIsActive = function(experimentKey,
139139
* Checks if a user is whitelisted into any variation, and returns that variation.
140140
* @param {Object} experiment The experiment to check for any forced variations.
141141
* @param {string} userId The ID of the user for whom to get the variation.
142-
* @return {string|null} The forced variation, if it exists, for the specified user ID; `null` otherwise.
142+
* @return {string|null} The forced variation for the specified user ID or `null` if a forced variation doesn't exist.
143143
*/
144144
DecisionService.prototype.__getWhitelistedVariation = function(experiment, userId) {
145145
if (!fns.isEmpty(experiment.forcedVariations) && experiment.forcedVariations.hasOwnProperty(userId)) {
@@ -159,11 +159,11 @@ DecisionService.prototype.__getWhitelistedVariation = function(experiment, userI
159159
};
160160

161161
/**
162-
* Checks if a user is included in an experiment's audience.
162+
* Returns a boolean indicating if a user is included in an experiment's audience.
163163
* @param {string} experimentKey The ID of the experiment being validated.
164164
* @param {string} userId The ID of the user to check.
165165
* @param {Object} attributes An optional key/value pair collection containing user attributes.
166-
* @return {boolean} `true` if the user meets audience conditions; `false` otherwise.
166+
* @return {boolean} `true` if the user satisfies the audience conditions or `false` if it doesn't.
167167
*/
168168
DecisionService.prototype.__checkIfUserIsInAudience = function(experimentKey, userId, attributes) {
169169
var experimentAudienceConditions = projectConfig.getExperimentAudienceConditions(this.configObj, experimentKey);
@@ -369,7 +369,7 @@ DecisionService.prototype._getExperimentInGroup = function(group, userId) {
369369
* @param {String} userId The ID of the user for the variation.
370370
* @param {Object} attributes An optional key/value pair collection containing user attributes.
371371
* @return {Object} An object containing 'experiment', 'variation', and 'decisionSource' properties.
372-
* If the user was not bucketed into a variation, the variation property is null. If there are no experiments in the rollout, the experiment property is null.
372+
* If the user was not bucketed into a variation, the variation property is `null`. If there are no experiments in the rollout, the experiment property is `null`.
373373
*/
374374
DecisionService.prototype._getVariationForRollout = function(feature, userId, attributes) {
375375
if (!feature.rolloutId) {
@@ -491,4 +491,4 @@ module.exports = {
491491
createDecisionService: function(options) {
492492
return new DecisionService(options);
493493
},
494-
};
494+
};

0 commit comments

Comments
 (0)