benjamine / jsondiffpatch

Diff & patch JavaScript objects
MIT License
4.79k stars 466 forks source link

What is the default call? #266

Closed Pomax closed 1 year ago

Pomax commented 5 years ago

I have zero interest in writing a complex config when what I need is bog standard object diffing: can the README be given an example of how to use jsondiffpatch without an options object?

Right now, the code crashes when you don't care to specify any options:

 return this.processor.process(new DiffContext(left, right));
                  ^

TypeError: Cannot read property 'processor' of undefined
    at diff (J:\Junctions\Users\Mike\Documents\Git\released\socketless\node_modules\jsondiffpatch\dist\jsondiffpatch.cjs.js:1459:19)
[...]

which should never happen: if no options are specified, the code should have loaded a sensible default that "just works", and then if that isn't what people want, then they can pass in an options object?

Methuselah96 commented 1 year ago

I'm not able to reproduce this issue. What version of jsondiffpatch are you using and what environment are you using it in? Sorry for the delayed response.

Pomax commented 1 year ago

No worries - I can't recall which project I was working in back when I filed this, but if I run into it again I'll refile it with better STR. (also wow I must have been angry at the time or something, that's a pretty rude posting, kudos for the professional response!)