How to get "Number of differences" from diff output

6 views
Skip to first unread message

Huzaifa S

unread,
Feb 21, 2016, 5:00:10 PM2/21/16
to Pretty Diff
With reference to code below, the XML Diff output is saved into variable "pz", This content has a line that says "Number of differences: 2320 differences from 630 lines of code." Can I get this info by looking up some internal property on the object pd? OR do I have to parse the output?

var options = {
api:""
source: srcXML,
diff: diffXML,
mode: "diff", // beautify, diff, minify, parse
lang: "auto"
};
var pd = prettydiff(options);
var pz = pd[0];

in...@prettydiff.com

unread,
Feb 22, 2016, 2:17:13 PM2/22/16
to prett...@googlegroups.com
Huzaifa,

Looking at the provided sample code you are assigning the result of a
prettydiff function to a variable "pd". The data you seek is in pd[1]
(the second and final index of the array).

I am not currently generating the diff counts as a stand alone data facet,
but I probably should.

Austin
> --
> You received this message because you are subscribed to the Google Groups
> "Pretty Diff" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pretty-diff...@googlegroups.com.
> To post to this group, send email to prett...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretty-diff/6791d418-d11a-44ef-91c6-7484ea02499b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


Reply all
Reply to author
Forward
0 new messages