Remove lodash.isequal in favor of built-in array method #1038
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:
Summary
I recently installed
fast-xml
as a replacement forcsv-stringify
, and while I was happy to see a bundle size reduction, I noticed that around half of the bundle size from its usage was coming fromlodash.isequal
.I noticed that this package is only used for one call that can be easily replaced with a native call to
Array.every
. The result should shave around 10KB (roughly half the total size) off bundle sizes in the browser.Test coverage
This case seems to be covering the case where
headers=true
is passed, but the headers are inferred from the first row, which is an array of strings, to prevent double-writing the headers. I verified that, when I changed this toreturn true
, 33 tests failed, implying significant coverage of this case.I also verified that there is a specific test covering exactly this behavior, at
RowFormatter.ts:119-124
(pasted here for clarity)