-
Notifications
You must be signed in to change notification settings - Fork 36
feat!: allow lossless crush
⇄ construct
use
#387
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
base: next
Are you sure you want to change the base?
Conversation
I'd like to avoid using Also, can you retarget this PR at the |
@aleclarson Rather than isEmpty, what do you think of just using the object test from isEmpty? !Object.keys(value).length P.S. I'm still relatively new to the whole pull request thing, so I think I figured out how to retarget to |
…undefined values added tests and fixed empty object as root
Benchmark Results
Performance regressions of 30% or more should be investigated, unless they were anticipated. Smaller regressions may be due to normal variability, as we don't use dedicated CI infrastructure. |
crush
⇄ construct
use
crush
⇄ construct
usecrush
⇄ construct
use
@mikerowe81 @aleclarson Since there was no documentation before about what this function returns, wouldn’t it be worth adding examples showing how it handles empty values? |
Summary
Updates
crush
andconstruct
functions to support empty arrays, empty objects, and undefined valuesRelated issue, if any:
#386
For any code change,
Does this PR introduce a breaking change?
No
Bundle impact
src/object/crush.ts
src/object/set.ts
Footnotes
Function size includes the
import
dependencies of the function. ↩