@@ -3,12 +3,13 @@ import JSONPane from "../components/JsonPane";
3
3
import { useParams , useNavigate } from "react-router-dom" ;
4
4
import { useEffect , useRef , useState } from "react" ;
5
5
import { _IDBStorageItem , useAppContext } from "../context/AppContext" ;
6
- import { JSONEditor , Content , Mode , OnChangeStatus , parseJSONPath , JSONPath } from "vanilla-jsoneditor" ;
6
+ import { JSONEditor , Content , Mode , OnChangeStatus , JSONPath } from "vanilla-jsoneditor" ;
7
7
import Loading from "./Loading" ;
8
8
import { BiSolidUpArrow , BiSolidDownArrow } from "react-icons/bi" ;
9
9
import { sortObj , cleanJSON } from "jsonabc" ;
10
10
import styles from "./compare.module.css" ;
11
11
import { JSONDiff , Difference , difference } from "../utils" ;
12
+ import { parseJSONPath } from "../utils/butils" ;
12
13
import * as utils from "../utils" ;
13
14
import { useWorker , WORKER_STATUS } from "../worker" ;
14
15
@@ -165,6 +166,7 @@ export default function Compare() {
165
166
const navigate = useNavigate ( ) ;
166
167
167
168
useEffect ( ( ) => {
169
+ // (window as any).test = parseJSONPath;
168
170
if ( id === undefined ) {
169
171
navigate ( "/compare/new" ) ;
170
172
return ;
@@ -270,6 +272,7 @@ export default function Compare() {
270
272
271
273
function highlightPath ( path : JSONPath ) {
272
274
let fn = async ( p : JSONPath ) => {
275
+ // console.log('using json path', p);
273
276
return encodeURIComponent ( `/${ p . map ( v => v . replace ( '/' , '~1' ) ) . join ( "/" ) } ` ) ;
274
277
} ;
275
278
let styleRules : Promise < string > [ ] = [ ] ;
@@ -290,11 +293,13 @@ export default function Compare() {
290
293
}
291
294
for ( let i = 0 ; i < sideDiff . extra . length ; i ++ ) {
292
295
let path = sideDiff . extra [ i ] ;
296
+ // console.log('using path', path);
293
297
let _path = parseJSONPath ( path . substring ( 2 ) ) ;
294
298
tasks . push ( highlightPath ( _path ) ) ;
295
299
}
296
300
for ( let i = 0 ; i < sideDiff . missing . length ; i ++ ) {
297
301
let path = sideDiff . missing [ i ] ;
302
+ // console.log('using path', path);
298
303
let _path = parseJSONPath ( path . substring ( 2 ) ) ;
299
304
tasks . push ( highlightPath ( _path ) ) ;
300
305
}
0 commit comments