This repository has been archived by the owner on Jan 24, 2022. It is now read-only.
Handle null options by not relying on object spread #1346
Labels
topic:tech-debt
Pending technical debt
A common pattern throughout the SDK when handling configuration is to merge default and received values using the spread operator. This works as long as unspecified keys are not present in the object, but fails if they exist with a
null
orundefined
value. As a workaround, we usepickBy
to remove these (but do so incorrectly, see #1231).Having to remember these quirks increases the mental overhead when developing for the SDK: we should instead not rely on object spread and properly handle keys with nil values when applying defaults.
The text was updated successfully, but these errors were encountered: