intelie / immutable-js-diff

MIT License
261 stars 32 forks source link

How do I interpret the results of a diff? #16

Closed joetidee closed 7 years ago

joetidee commented 7 years ago

When I run a diff on to Maps, I get the following:

List
__altered: false
__hash: undefined
__ownerID: undefined
_capacity: 1
_level: 5
_origin: 0
_root: undefined
_tail: undefined
size: 1

How do I interpret these results?

pedroteixeira commented 7 years ago

Hi, it's immutable list. You can call .toJSON() to convert to native data structures for example.

joetidee commented 7 years ago

Right, but this informaiton is not telling me anything about what the different was, for example, what does 'capacity' mean?

pedroteixeira commented 7 years ago

You are looking at the internal structure of the Immutable.List.. Try calling results.toJSON() to see the actual data.

For a visual output, there are few libraries out there than can render html as well, as such as https://github.com/cezary/react-diff