@rslike/cmp: compare your structures like a pro
Vitali Haradkouvitalics
The Problem
At the previous article I was described my new package distributed via npm - @rslike/std
- standard JS library which allows to remove undefined behavior in your code. But today, std is not a part of our story.
The Solution
Today, I’m gonna show you comparison package(@rslike/cmp
). Using this package you can compare your classes and(or) objects like a pro.
How to install:
I highly recommend to install @rslike/std
package too, since if you would like to implement PartialEq - you need to use Option from @rslike/std
package
Usage:
Easy, isn’t it?
That’s because I use the same(mostly inspired) types(traits) from rustlang.
That’s it for today. Check it out std
package.
UPD
P.S. I was release 2.x version since new package cmp was included and now here is 3 packages: