Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 1f25b20

Browse files
authored
Merge branch 'master' into zeeshan/replace-lodash-keyby
2 parents e40c2eb + d298f48 commit 1f25b20

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

packages/optimizely-sdk/lib/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ declare module "@optimizely/optimizely-sdk" {
115115
onReady(options?: {
116116
timeout?: number;
117117
}): Promise<{ success: boolean; reason?: string }>;
118-
close(): void;
118+
close(): Promise<{ success: boolean; reason?: string }>;
119119
}
120120

121121
// An event to be submitted to Optimizely, enabling tracking the reach and impact of

packages/optimizely-sdk/lib/plugins/event_dispatcher/index.browser.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
var fns = require('../../utils/fns');
17-
1816
var POST_METHOD = 'POST';
1917
var GET_METHOD = 'GET';
2018
var READYSTATE_COMPLETE = 4;
@@ -68,7 +66,7 @@ module.exports = {
6866
};
6967

7068
var toQueryString = function(obj) {
71-
return fns.map(obj, function(v, k) {
72-
return encodeURIComponent(k) + '=' + encodeURIComponent(v);
69+
return Object.keys(obj).map(function(k) {
70+
return encodeURIComponent(k) + '=' + encodeURIComponent(obj[k]);
7371
}).join('&');
7472
};

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ module.exports = {
2525
currentTimestamp: function() {
2626
return Math.round(new Date().getTime());
2727
},
28-
isArray: require('lodash/isArray'),
2928
isEmpty: require('lodash/isEmpty'),
3029
isFinite: function(number) {
3130
return _isFinite(number) && Math.abs(number) <= MAX_NUMBER_LIMIT;
@@ -38,7 +37,6 @@ module.exports = {
3837
},
3938
forEach: require('lodash/forEach'),
4039
forOwn: require('lodash/forOwn'),
41-
map: require('lodash/map'),
4240
uuid: function() {
4341
return uuid.v4();
4442
},

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
var fns = require('../fns');
1716
var validate = require('json-schema').validate;
1817
var sprintf = require('@optimizely/js-sdk-utils').sprintf;
1918

@@ -40,7 +39,7 @@ module.exports = {
4039
if (result.valid) {
4140
return true;
4241
} else {
43-
if (fns.isArray(result.errors)) {
42+
if (Array.isArray(result.errors)) {
4443
throw new Error(sprintf(ERROR_MESSAGES.INVALID_DATAFILE, MODULE_NAME, result.errors[0].property, result.errors[0].message));
4544
}
4645
throw new Error(sprintf(ERROR_MESSAGES.INVALID_JSON, MODULE_NAME));

0 commit comments

Comments
 (0)