Description
This will unify type-checking logic, probably prevent bugs, and possibly obviate an asJSON call.
Desired behavior/Acceptance criteria (returned value, expected error, performance expectations, etc.)
- don't compare complex Type objects with == or ===; use compareTypes
Completion checklist
- Before closing this task, review one by one the checklist available here: https://www.mediawiki.org/wiki/Abstract_Wikipedia_team/Definition_of_Done#Back-end_Task/Bug_completion_checklist