Comments (2)
Since this library is dealing with State, only comparison of keys within the object should ever be considered whether that's with natural, surrogate, or composite keys. I implemented basic keys within strings (natural and surrogate), but do think composite keys would be nice. Additional checks would be introducing side-effects, and limiting those is best.
I don't think a matcher function is beneficial to everyone in the sense that most would not provide this and if they are writing a basic matcher function, they probably already know what they want to compare and won't use this library. Although, you bring up a valid point in that composite keys should be implemented.
I would be open to adding that in with an additional array argument of keys vs the single that exists. Also, from your PR using indexOf is faster than several other methods and why I used it. I mean I can make it extremely short with 100% ES6+ code, but I was concerned with performance and speed. Anyways, if you want to implement something that can take a given list of composite keys to check I'm game. Thanks for your input!
from crud-compare.
OK. understood.
from crud-compare.
Related Issues (7)
- feature request: return indexes HOT 8
- compareObjectVals' updatedVals contains all fields, not just the ones that changed HOT 3
- Update compare for generic types.
- [Bug] invalid isEqualObject where left side has undefined values HOT 1
- [Incomplete deps] error when trying to build HOT 3
- [improvement] better key finding HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crud-compare.