Skip to content
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

Ignore certain kinds of kind #105

Open
elmarti opened this issue May 23, 2017 · 0 comments
Open

Ignore certain kinds of kind #105

elmarti opened this issue May 23, 2017 · 0 comments

Comments

@elmarti
Copy link

elmarti commented May 23, 2017

I'm trying to only list structural differences, so I'm not interested in the text content. Is there a more efficient way of filtering them out than the following? (I know forEach isn't the most efficient)

var data1= require("./data1.json);
var data2= require("./data2.json");
var diff = require("deep-diff").diff;

var differences = diff(data1, data2);
differences.forEach(function(thisDiff){
   if(thisDiff.kind !== "E")
       console.log(thisDiff);
});
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

1 participant