fix(task): correctly sort objects within arrays and vice versa