@@ -87,8 +87,15 @@ export const buildTreeFromDoc = (
8787 if ( Array . isArray ( doc ) ) {
8888 doc . forEach ( ( item , i ) => {
8989 const path = `${ curPath } /[${ i } ]` ;
90+ if ( linkMap . has ( path ) ) {
91+ // console.log("PATH", path);
92+ // console.log("has exact", linkMap.has(path));
93+ // console.log("has _DataLink_", linkMap.has(`${path}/_DataLink_`));
94+ } else {
95+ // console.log("nothing matching in array docs");
96+ }
97+
9098 const linkHere = linkMap . get ( path ) || linkMap . get ( `${ path } /_DataLink_` ) ;
91- // For primitive items, show "1: value" in the *name*
9299 const isPrimitive =
93100 item === null || [ "string" , "number" , "boolean" ] . includes ( typeof item ) ;
94101 const label = isPrimitive ? `${ i } : ${ formatLeafValue ( item ) } ` : String ( i ) ; // objects/arrays just show "1", "2", ...
@@ -97,7 +104,7 @@ export const buildTreeFromDoc = (
97104 out . push ( {
98105 kind : "folder" ,
99106 // name: `[${i}]`,
100- name : label ,
107+ name : label , // For primitive items, show "1: value" in the name
101108 path,
102109 link : linkHere ,
103110 children : buildTreeFromDoc ( item , linkMap , path ) ,
@@ -113,12 +120,21 @@ export const buildTreeFromDoc = (
113120 } ) ;
114121 }
115122 } ) ;
123+ // console.log("out", out);
116124 return out ;
117125 }
118126
119127 Object . keys ( doc ) . forEach ( ( key ) => {
120128 const val = doc [ key ] ;
121129 const path = `${ curPath } /${ key } ` ;
130+ if ( linkMap . has ( path ) ) {
131+ // console.log("PATH", path);
132+ // console.log("has exact", linkMap.has(path));
133+ // console.log("has _DataLink_", linkMap.has(`${path}/_DataLink_`));
134+ } else {
135+ // console.log("nothing match in object keys");
136+ }
137+
122138 const linkHere = linkMap . get ( path ) || linkMap . get ( `${ path } /_DataLink_` ) ;
123139
124140 if ( val && typeof val === "object" ) {
0 commit comments