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
Current dotobject behavior is to return the most nearest parent found, whilst it should be returning null (or undefined) when not finding a key
To Reproduce
Use election.get('token.type') in an election not having token.type defined. If it has token it will return token's contents; when not having even the token field defined, it returns the parent meta one.
Expected behavior
To have a falsy return when the key does not exist.
Workaround
Right now, to workaround this, I'm checking the type of the response whenever possible, i.e.
Describe the bug
Current dotobject behavior is to return the most nearest parent found, whilst it should be returning null (or undefined) when not finding a key
To Reproduce
Use
election.get('token.type')
in an election not havingtoken.type
defined. If it hastoken
it will returntoken
's contents; when not having even thetoken
field defined, it returns the parentmeta
one.Expected behavior
To have a falsy return when the key does not exist.
Workaround
Right now, to workaround this, I'm checking the type of the response whenever possible, i.e.
Otherwise in cases like this it would fail, since objects cannot be directly render as JSX elements.
Additional context
I'll try to fix it myself, since it was implemented by me (unless someone wants to dig in it first, ofc).
The text was updated successfully, but these errors were encountered: