File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -59,20 +59,20 @@ var JsonDiffReact = function (_Component) {
5959 tips = _props . tips ,
6060 objectHash = _props . objectHash ;
6161
62- var delta = Jsondiffpatch . create ( { objectHash : objectHash } ) . diff ( left , right ) ;
62+ var delta = Jsondiffpatch . create ( {
63+ objectHash : objectHash ,
64+
65+ arrays : {
66+ // default true, detect items moved inside the array (otherwise they will be registered as remove+add)
67+ detectMove : true ,
68+ // default false, the value of items moved is not included in deltas
69+ includeValueOnMove : true
70+ }
71+ } ) . diff ( left , right ) ;
6372 var html = annotated ? formatters . annotated . format ( delta ) : formatters . html . format ( delta , left ) ;
6473 show ? formatters . html . showUnchanged ( ) : formatters . html . hideUnchanged ( ) ;
6574 console . log ( "test" ) ;
66- return html ? _react2 . default . createElement (
67- "span" ,
68- null ,
69- _react2 . default . createElement (
70- "h1" ,
71- null ,
72- "hi there"
73- ) ,
74- _react2 . default . createElement ( "div" , { dangerouslySetInnerHTML : { __html : html } } )
75- ) : _react2 . default . createElement (
75+ return html ? _react2 . default . createElement ( "div" , { dangerouslySetInnerHTML : { __html : html } } ) : _react2 . default . createElement (
7676 "p" ,
7777 { style : { fontSize : 12 , color : "#999" } } ,
7878 tips || "Both objects are identical."
You can’t perform that action at this time.
0 commit comments