Skip to content

Commit 843a913

Browse files
committed
changed the method name
1 parent 54effe9 commit 843a913

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ DecisionService.prototype.__saveUserProfile = function(experiment, variation, us
263263
}
264264

265265
try {
266-
var newBucketMap = fns.cloneDeep(experimentBucketMap);
266+
var newBucketMap = fns.cloneJsonObject(experimentBucketMap);
267267
newBucketMap[experiment.id] = {
268268
variation_id: variation.id
269269
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ describe('lib/core/decision_service', function() {
619619
it('should return null when a variation was previously set, and that variation no longer exists on the config object', function() {
620620
var didSetVariation = decisionServiceInstance.setForcedVariation(configObj, 'testExperiment', 'user1', 'control');
621621
assert.strictEqual(didSetVariation, true);
622-
var newDatafile = fns.cloneDeep(testData);
622+
var newDatafile = fns.cloneJsonObject(testData);
623623
// Remove 'control' variation from variations, traffic allocation, and datafile forcedVariations.
624624
newDatafile.experiments[0].variations = [{
625625
key: 'variation',

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = {
3535
* @return {Object} Object representing project configuration
3636
*/
3737
createProjectConfig: function(datafile) {
38-
var projectConfig = fns.cloneDeep(datafile);
38+
var projectConfig = fns.cloneJsonObject(datafile);
3939

4040
/*
4141
* Conditions of audiences in projectConfig.typedAudiences are not
@@ -53,7 +53,7 @@ module.exports = {
5353

5454
var experiments;
5555
fns.forEach(projectConfig.groupIdMap, function(group, Id) {
56-
experiments = fns.cloneDeep(group.experiments);
56+
experiments = fns.cloneJsonObject(group.experiments);
5757
fns.forEach(experiments, function(experiment) {
5858
projectConfig.experiments.push(fns.assign(experiment, {groupId: Id}));
5959
});
@@ -62,7 +62,7 @@ module.exports = {
6262
projectConfig.rolloutIdMap = fns.keyBy(projectConfig.rollouts || [], 'id');
6363
fns.forOwn(projectConfig.rolloutIdMap, function(rollout) {
6464
fns.forEach(rollout.experiments || [], function(experiment) {
65-
projectConfig.experiments.push(fns.cloneDeep(experiment));
65+
projectConfig.experiments.push(fns.cloneJsonObject(experiment));
6666
// Creates { <variationKey>: <variation> } map inside of the experiment
6767
experiment.variationKeyMap = fns.keyBy(experiment.variations, 'key');
6868
});

packages/optimizely-sdk/lib/optimizely/index.tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3792,7 +3792,7 @@ describe('lib/optimizely', function() {
37923792
describe('when the variation is missing the toggle', function() {
37933793
beforeEach(function() {
37943794
var experiment = optlyInstance.projectConfigManager.getConfig().experimentKeyMap.test_shared_feature;
3795-
var variation = fns.cloneDeep(experiment.variations[0]);
3795+
var variation = fns.cloneJsonObject(experiment.variations[0]);
37963796
delete variation['featureEnabled'];
37973797
sandbox.stub(optlyInstance.decisionService, 'getVariationForFeature').returns({
37983798
experiment: experiment,

0 commit comments

Comments
 (0)