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

html formatter error when diffing with an array with undefined values #367

Closed
DVLP opened this issue Apr 30, 2024 · 1 comment
Closed

html formatter error when diffing with an array with undefined values #367

DVLP opened this issue Apr 30, 2024 · 1 comment

Comments

@DVLP
Copy link

DVLP commented Apr 30, 2024

The array values are undefined deliberately

html.format is giving this
image
Diff returned by jsondiffpatchinstance.diff
image

It could be because formatValue in HtmlFormatter is expecting JSON.stringify to return a string but for undefined JSON.stringify returns undefined

@benjamine
Copy link
Owner

benjamine commented Mar 28, 2025

pushing a small fix to prevent the error, although I think having undefined values could break your diffs in other unexpectable ways.

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