Skip to content
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

refactor: replace lodash with small libraries #507

Merged
merged 1 commit into from Mar 27, 2021

Conversation

TrySound
Copy link
Contributor

@TrySound TrySound commented Mar 27, 2021

camelcase and is-plain-obj are small, single purpose and
dependency free utilities with builtin TS support. They cover all
left lodash usages.

`camelcase` and `is-plain-obj` are small, single purpose and
dependency free utilities with builtin TS support.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 88.149% when pulling ce3eb29 on TrySound:drop-lodash into 5dec5dc on chimurai:master.

@chimurai
Copy link
Owner

chimurai commented Mar 27, 2021

That's funny, just created almost the same branch; 9 minutes prior to your PR :D

} else if (
rewriteConfig === undefined ||
rewriteConfig === null ||
_.isEqual(rewriteConfig, {})
Copy link
Owner

Choose a reason for hiding this comment

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

_.isEqual(rewriteConfig, {}) check is now missing in the refactored code. Think the vanilla version would be: JSON.stringify(rewriteConfig) === '{}'.

Copy link
Contributor Author

@TrySound TrySound Mar 27, 2021

Choose a reason for hiding this comment

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

Comparing to empty object means it should be plain one, right? There is plain object check above. I moved Object.keys length check to return value instead. So isEqual check is redundant.

Copy link
Owner

Choose a reason for hiding this comment

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

Ah, you're right. Missed that part. 👌

@TrySound
Copy link
Contributor Author

TrySound commented Mar 27, 2021

I would stick to Sindre's version. In my experience it's more popular than is-plain-object (which I maintain).

@chimurai chimurai merged commit 7c3fd07 into chimurai:master Mar 27, 2021
@chimurai
Copy link
Owner

Thanks!

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.

None yet

3 participants