Skip to content

Does not detect differences in order #42

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

Closed
giorgio79 opened this issue Nov 13, 2018 · 2 comments
Closed

Does not detect differences in order #42

giorgio79 opened this issue Nov 13, 2018 · 2 comments

Comments

@giorgio79
Copy link

giorgio79 commented Nov 13, 2018

When diffing two objects where I would like the order of keys to matter:


const { diff, addedDiff, deletedDiff, detailedDiff, updatedDiff } = require("deep-object-diff");

const right = {
1: "Tom",
2: "reads",
3: ",",
4: "novels"
};

const wrong = {
1: "Tom",
2: "reads",
3: "novels",
4: ","
};

console.log(detailedDiff(right, wrong)); 

And the result is:

Object {added: , deleted: , updated: }

@mattphillips
Copy link
Owner

Seems to working fine check out: https://runkit.com/embed/uy9n61eue7s3

It logs:

added: Object {}
deleted: Object {}
updated: Object {3: "novels", 4: ","}

@giorgio79
Copy link
Author

Right! Thanks and sry! :) I did not click the arrow to expand the result:

image

image

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

No branches or pull requests

2 participants