-
Notifications
You must be signed in to change notification settings - Fork 852
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
Conversation
`camelcase` and `is-plain-obj` are small, single purpose and dependency free utilities with builtin TS support.
That's funny, just created almost the same branch; 9 minutes prior to your PR :D |
} else if ( | ||
rewriteConfig === undefined || | ||
rewriteConfig === null || | ||
_.isEqual(rewriteConfig, {}) |
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.
_.isEqual(rewriteConfig, {})
check is now missing in the refactored code. Think the vanilla version would be: JSON.stringify(rewriteConfig) === '{}'
.
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.
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.
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.
Ah, you're right. Missed that part. 👌
I would stick to Sindre's version. In my experience it's more popular than is-plain-object (which I maintain). |
Thanks! |
camelcase
andis-plain-obj
are small, single purpose anddependency free utilities with builtin TS support. They cover all
left lodash usages.