Skip to content

Commit 33e0efc

Browse files
committed
Finalized
1 parent 9c9699b commit 33e0efc

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ var logging = require('@optimizely/js-sdk-logging');
2121

2222
var logger = logging.getLogger();
2323

24-
var _ = require('lodash/core');
2524
var fns = require('../../utils/fns');
2625
var chai = require('chai');
2726
var assert = chai.assert;
@@ -40,7 +39,7 @@ describe('lib/core/project_config', function() {
4039
var testData = testDatafile.getTestProjectConfig();
4140
var configObj = projectConfig.createProjectConfig(testData);
4241

43-
_.forEach(testData.audiences, function(audience) {
42+
(testData.audiences || []).forEach(function(audience) {
4443
audience.conditions = JSON.parse(JSON.stringify(audience.conditions));
4544
});
4645

@@ -59,14 +58,14 @@ describe('lib/core/project_config', function() {
5958
assert.deepEqual(configObj.groupIdMap, expectedGroupIdMap);
6059

6160
var expectedExperiments = testData.experiments;
62-
_.forEach(configObj.groupIdMap, function(group, Id) {
63-
_.forEach(group.experiments, function(experiment) {
61+
Object.keys(configObj.groupIdMap || {}).forEach(function(group, Id) {
62+
(group.experiments || []).forEach(function(experiment) {
6463
experiment.groupId = Id;
6564
expectedExperiments.push(experiment);
6665
});
6766
});
6867

69-
_.forEach(expectedExperiments, function(experiment) {
68+
(expectedExperiments || []).forEach(function(experiment) {
7069
experiment.variationKeyMap = fns.keyBy(experiment.variations, 'key');
7170
});
7271

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ var eventProcessorConfigValidator = require('./utils/event_processor_config_vali
2525

2626
var chai = require('chai');
2727
var assert = chai.assert;
28-
var find = require('lodash/find');
2928
var sinon = require('sinon');
3029

3130
var LocalStoragePendingEventsDispatcher = eventProcessor.LocalStoragePendingEventsDispatcher;

packages/optimizely-sdk/lib/utils/attributes_validator/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
*/
2020

2121
var sprintf = require('@optimizely/js-sdk-utils').sprintf;
22-
var lodashForOwn = require('lodash/forOwn');
2322
var fns = require('../../utils/fns');
23+
var jsSdkUtils = require('@optimizely/js-sdk-utils');
2424

2525
var ERROR_MESSAGES = require('../enums').ERROR_MESSAGES;
2626
var MODULE_NAME = 'ATTRIBUTES_VALIDATOR';
@@ -34,8 +34,8 @@ module.exports = {
3434
*/
3535
validate: function(attributes) {
3636
if (typeof attributes === 'object' && !Array.isArray(attributes) && attributes !== null) {
37-
lodashForOwn(attributes, function(value, key) {
38-
if (typeof value === 'undefined') {
37+
Object.keys(attributes).map(function(key) {
38+
if (typeof attributes[key] === 'undefined') {
3939
throw new Error(sprintf(ERROR_MESSAGES.UNDEFINED_ATTRIBUTE, MODULE_NAME, key));
4040
}
4141
});

packages/optimizely-sdk/package-lock.json

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/optimizely-sdk/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"@optimizely/js-sdk-logging": "^0.1.0",
3939
"@optimizely/js-sdk-utils": "^0.2.0",
4040
"json-schema": "^0.2.3",
41-
"lodash": "^4.17.11",
4241
"murmurhash": "0.0.2",
4342
"promise-polyfill": "8.1.0",
4443
"uuid": "^3.3.2"

0 commit comments

Comments
 (0)