chore(deps): replace some Lodash functions with vanilla JS#1202
Open
chore(deps): replace some Lodash functions with vanilla JS#1202
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes to Core Features:
Heya, I have noticed that fast-csv pulls quite a lot of dependencies and got curious. I saw all of them are Lodash functions. I first wanted to propose replacing them with just Lodash (or, if you'd ask me, es-toolkit), but Jordan's reasoning in #761 made me reconsider this.
I then noticed, however, that some Lodash functions you use are way too simple and could be replaced with vanilla JS. So, I did. See also #1038
_.isNil=>== nullundefined, which is Lodash behaviour_.isUndefined=>== undefined_.isBoolean=>typeof ... === 'boolean'_.isFunction=>typeof ... === 'function'This removes three dependencies from each
@fast-csv/formatand@fast-csv/parse. According to pkg-size, the removed packages attributed to 7.3% of the package's install size.The replacements were taken from es-toolkit documentation, es-toolkit source code, or from common sense :) I haven't replaced other functions because they're not one-liners