8000 refactor: Removed dependency on lodash.map (#409) · github/optimizely-javascript-sdk@7994910 · GitHub
[go: up one dir, main page]

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

Commit 7994910

Browse files
authored
refactor: Removed dependency on lodash.map (optimizely#409)
Summary: To reduce package size, we are trying to gradually get rid of lodash library. This PR removes the map function. Test plan: All tests pass after this change.
1 parent 5a521db commit 7994910

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ module.exports = {
3232
keyBy: require('lodash/keyBy'),
3333
forEach: require('lodash/forEach'),
3434
forOwn: require('lodash/forOwn'),
35-
map: require('lodash/map'),
3635
uuid: function() {
3736
return uuid.v4();
3837
},

0 commit comments

Comments
 (0)
0