8000 Merge branch 'master' into fayyaz/replace_lodash_isEmpty · optimizely/javascript-sdk@89f476c · GitHub
[go: up one dir, main page]

Skip to content

Commit 89f476c

Browse files
author
Matt Carroll
committed
Merge branch 'master' into fayyaz/replace_lodash_isEmpty
2 parents 0dc6a43 + d298f48 commit 89f476c

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
@@ -24,14 +24,12 @@ module.exports = {
2424
currentTimestamp: function() {
2525
return Math.round(new Date().getTime());
2626
},
27-
isArray: require('lodash/isArray'),
2827
isFinite: function(number) {
2928
return _isFinite(number) && Math.abs(number) <= MAX_NUMBER_LIMIT;
3029
},
3130
keyBy: require('lodash/keyBy'),
3231
forEach: require('lodash/forEach'),
3332
forOwn: require('lodash/forOwn'),
34-
map: require('lodash/map'),
3533
uuid: function() {
3634
return uuid.v4();
3735
},

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)
0