-
-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: comparable function #345
refactor: comparable function #345
Conversation
Why do you think this is necessary? |
I think it's a bit easier to understand for newcomers on the project and since it is used across the project. That's why those 2 functions are private and exist only in the module. I also didn't like use of any type and change it to be more generic and i used unknown instead any in Record type. |
Maybe there is a way to avoid |
@fabian-hiller it could be solved with JSON.stringify and i removed comparable. |
|
@fabian-hiller i allready rewrote tests and remove comparison function in this PR :). |
One thing to note is that if the properties are in a different order, the |
@fabian-hiller indeed good to note that, do you think is this a feature or issue? :) |
The order should not matter. That's why we should probably stick with |
@fabian-hiller we could use extend matchers and add extra method toCompare? extending-matchers |
Can you send some sample code showing how you would implement it? |
@fabian-hiller i implemented changes with custom vitest matcher toEqualSchema in this PR. I was not sure regarding naming for toEqualSchema matcher or maybe toCompare? |
Thank you! This looks great. I will review it once I made some more progress in other areas of the library. |
b997a0f
to
6d0cde4
Compare
Since we removed this function is the previous rewrite, I will close this PR. |
No description provided.