In my opinion, now you have the mental burden of both approaches.
Personally, I'd want to choose one.
In my point of view, if you have to have a couple of if-statements before checking the map, that's a sure sign that the map is the wrong abstraction - for example, maybe the type inside the map is the wrong type and you may need to consider adding more abstraction, e.g. a type that covers all your cases; again, being aware of the complexity trade-off.
Maybe it's worth it, maybe it isn't. This is where the job gets hard 😉
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
In my opinion, now you have the mental burden of both approaches.
Personally, I'd want to choose one.
In my point of view, if you have to have a couple of if-statements before checking the map, that's a sure sign that the map is the wrong abstraction - for example, maybe the type inside the map is the wrong type and you may need to consider adding more abstraction, e.g. a type that covers all your cases; again, being aware of the complexity trade-off.
Maybe it's worth it, maybe it isn't. This is where the job gets hard 😉