-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#279 default json compare (no instance)
- Loading branch information
Jonas Hoyer
committed
Aug 20, 2024
1 parent
819f9aa
commit f1e2391
Showing
1 changed file
with
2 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,14 +24,10 @@ private static String htmlScript(String expectedJson, String actualJson) | |
+ "<script type=\"module\">" | ||
+ "import * as jsondiffpatch from 'https://esm.sh/[email protected]';" | ||
+ "import * as htmlFormatter from 'https://esm.sh/[email protected]/formatters/html';" | ||
|
||
+ "const jsondiffpatchInstance = jsondiffpatch.create({" | ||
+ "objectHash: function (obj) {return obj._id || obj.id;}," | ||
+ "arrays: {detectMove: false}" | ||
+ "});" | ||
|
||
+ "const left = " + expectedJson + ";" | ||
+ "const right = " + actualJson + ";" | ||
+ "const delta = jsondiffpatchInstance.diff(left, right);" | ||
+ "const delta = jsondiffpatch.diff(left, right);" | ||
+ "document.getElementById('visual').innerHTML = htmlFormatter.format(delta, left);" | ||
+ "</script>" | ||
+ "<script>" | ||
|