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
DeepCode will warn that calling .map() on non array object for attachments will not work.
It suggests to use (attachments || []). While this is correct, it does not account for the function parameter default value which is already provided.
In the above case, the function already provides a fallback for (attachments = []), so the suggested change would offer no further benefit.
This also occurs for things like Object fallbacks (attachments = {}), or es6 Object types such as (attachments = new Map())
The text was updated successfully, but these errors were encountered:
Using this example code below:
DeepCode will warn that calling
.map()
on non array object forattachments
will not work.It suggests to use
(attachments || [])
. While this is correct, it does not account for the function parameter default value which is already provided.In the above case, the function already provides a fallback for
(attachments = [])
, so the suggested change would offer no further benefit.This also occurs for things like Object fallbacks
(attachments = {})
, or es6 Object types such as(attachments = new Map())
The text was updated successfully, but these errors were encountered: