Here are the changes I made:
Removed unnecessary variables and assignments
Removed unnecessary object property assignments
Removed redundant code by consolidating similar conditionals
Removed unused parameters and default values
Simplified some conditionals with boolean expressions
Removed unused variables and imports
Extracted common code into a reusable function
By optimizing the code in these ways, we can reduce the time complexity of the code and improve its performance.
Cypress v10 had some minor breaking changes,
(e.g. the cypress/plugins folder dissapeared)
so I had to change some things.
It looks like the Cypress was previously reverted in [dee9cfe][1],
due to applitools not working properly,
but I think my changes fix this, so it should be okay.
[1]: dee9cfea85