Skip to content

Support optional keys to ignore #10

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

Conversation

eric-hansen
Copy link

No description provided.

@tjconcept
Copy link
Member

tjconcept commented Jul 24, 2017

Hi @eric-hansen,

Thanks a lot for your interest in improving this library, and the very comprehensive PR!

I am a bit reluctant to merge this because I generally favour composition of packages over growing package sizes and, as far as I can see, the same behaviour could be reached by combining this package with something like https://www.npmjs.com/package/without-keys:

const diff = require('object-diff')
const wo = require('without-keys')
diff(a, wo(b, [ 'name' ]))

Do you have a use case where this would not work?

@eric-hansen
Copy link
Author

I've never seen without-keys package before so not really. I understand your point.

My current use-case for this library just falls under the need of not comparing every key of the object. Saw there was no option for this and figured I'd submit a PR for it. Personally I just prefer not using more libraries than necessary when possible.

If you feel the route you proposed is sufficient enough then that's cool. Just thought I'd toss this your way.

@tjconcept
Copy link
Member

Personally I just prefer not using more libraries than necessary when possible.

Absolutely, but, in my opinion, never at the cost of added complexity :)

Thanks again for taking the time.

@tjconcept tjconcept closed this Jul 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants