Skip to content

Conversation

@fayyazarshad
Copy link
Contributor

Summary

to reduce package size, we are trying to gradually get rid of lodash library. This PR replaces isEmpty function simple implementation for object. Because we are using this methods for object only

Test plan

Added unit tests for this

@fayyazarshad fayyazarshad self-assigned this Feb 19, 2020
@coveralls
Copy link

coveralls commented Feb 19, 2020

Coverage Status

Coverage remained the same at 97.558% when pulling 89f476c on fayyaz/replace_lodash_isEmpty into d298f48 on master.

@zashraf1985 zashraf1985 changed the title Removed isEmpty method of Lodash Removed dependency on lodash.isEmpty Feb 19, 2020
@zashraf1985 zashraf1985 marked this pull request as ready for review February 20, 2020 00:11
@zashraf1985 zashraf1985 requested a review from a team as a code owner February 20, 2020 00:11
Copy link
Contributor

@mjc1283 mjc1283 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fayyazarshad @zashraf1985 I was looking around at the places where isEmpty is called. It seems like we don't actually need this. I think they could be replaced by a check for a truth-y value.

For example( getExperimentId, packages/optimizely-sdk/lib/core/project_config/index.js) instead of :

    var experiment = projectConfig.experimentKeyMap[experimentKey];
    if (fns.isEmpty(experiment)) {

We can do:

    var experiment = projectConfig.experimentKeyMap[experimentKey];
    if (!experiment) {

@mjc1283 mjc1283 merged commit ee5a24d into master Feb 21, 2020
@mjc1283 mjc1283 deleted the fayyaz/replace_lodash_isEmpty branch February 21, 2020 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants