You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The smithy generator overrides the deserializeMap function, however I think the behaviour is somewhat counter intuitive.
First of all for sparse maps it will ignore null values, but not undefined values. I would expect that if null values are ignored, that undefined values are definitely ignored. This is especially confusing as JSON.stringify does ignore undefined values, but not null values.
Furthermore, a new object is constructed for every key. While this makes the reduce a nice pure function, it does mean it is way slower than it needs to be, allocating a new object for each key it adds.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The smithy generator overrides the
deserializeMap
function, however I think the behaviour is somewhat counter intuitive.First of all for sparse maps it will ignore
null
values, but notundefined
values. I would expect that ifnull
values are ignored, that undefined values are definitely ignored. This is especially confusing asJSON.stringify
does ignoreundefined
values, but notnull
values.Furthermore, a new object is constructed for every key. While this makes the reduce a nice pure function, it does mean it is way slower than it needs to be, allocating a new object for each key it adds.
Beta Was this translation helpful? Give feedback.
All reactions