Looks like the `type == JSON_TYPE.OBJECT` check is performed twice here.