-
Notifications
You must be signed in to change notification settings - Fork 83
Removed dependency on lodash.isEmpty #403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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) {
2be9a53
to
2d1a069
Compare
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